Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
119487 | 常钰杰 | 水仙花数II | C++ | Accepted | 1 MS | 276 KB | 550 | 2025-05-17 16:53:56 |
#include "bits/stdc++.h" using namespace std; int Sc(int a) { int ans = a * a * a; return ans; } int main() { int m,n; int flag = 0; cin >> m >> n; for(int i = m; i <= n;i++) { int b = i / 100; int s = i % 100 / 10; int g = i % 10; b = Sc(b); s = Sc(s); g = Sc(g); if(i == b + s + g) { flag = 1; cout << i << " "; } } if(flag == 0) { cout << "no"; } return 0; }