6 条题解

  • 0
    @ 2026-8-13 15:06:24
    #include <bits/stdc++.h>
    using namespace std;
    
    int main() {
    	int a, b, c, d;
    	cin >> a;
    	b = a / 100;
    	c = a / 10 - b * 10;
    	d = a % 10;
    	if (pow(b, 3) + pow(c, 3) + pow(d, 3) == a) {
    		cout << "YES";
    	} else {
    		cout << "NO";
    	}
    	return 0;
    }
    
    
    
    • -1
      @ 2026-6-6 11:37:13

      #include using namespace std;

      int main() { int n; cin >> n; int a = n / 100; //百位 int b = n / 10 % 10; //十位 int c = n % 10; //个位

      int sum = a*a*a + b*b*b + c*c*c;
      if(sum == n)
          cout << "YES" << endl;
      else
          cout << "NO" << endl;
      return 0;
      

      } 水仙花数:百位立方 + 十位立方 + 个位立方 = 原数 例

      • -1
        @ 2026-6-3 20:00:06

        #include using namespace std;

        int main() { int n, a, b, c; int sum = 0; cin >> n; a = n / 100; b = n % 100 / 10; c = n % 10; sum = a * a * a + b * b * b + c * c * c; if (sum == n) { cout << "YES"; } else { cout << "NO"; } return 0; }

      • -1
        @ 2026-5-23 15:41:08

        #include <bits/stdc++.h> using namespace std;

        int main() { long long a,b,c,d; cin>>a; b=a/100; c=a%100/10; d=a%100%10; if(bbb+ccc+ddd==a){ cout<<"YES"; } else{ cout<<"NO"; } return 0; }

      • -6
        @ 2026-5-23 11:33:10

        数学老师没教过>:(

      • -9
        @ 2026-5-23 19:56:37

        #include using namespace std;

        int main() { int n; cin >> n; int a = n/100, b = n/10%10, c = n%10; cout << (aaa + bbb + ccc == n ? "YES" : "NO"); return 0; }

        • 1

        信息

        ID
        30933
        时间
        1000ms
        内存
        256MiB
        难度
        7
        标签
        (无)
        递交数
        218
        已通过
        58
        上传者