Browse Source

添加 'F.cpp'

webturing 5 years ago
parent
commit
848f623fc0
1 changed files with 15 additions and 0 deletions
  1. 15 0
      F.cpp

+ 15 - 0
F.cpp

@@ -0,0 +1,15 @@
+#include<bits/stdc++.h>
+using namespace std;
+int main() {   
+    int a, b, c;
+    for (int m=100;m <= 999;m++) {
+        a = m / 100;
+        b = m % 10;
+        c = m % 100 / 10;
+        if (a * a * a + b * b * b + c * c * c == m) {
+            cout << m << endl;
+        }
+      
+    }
+    return 0;
+}