Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
125763 陈华仁星 水仙花数II C++ Accepted 1 MS 268 KB 365 2025-07-15 14:54:03

Tests(10/10):


Code:

#include <iostream> #include <algorithm> using namespace std; int main() { int n,m,a,b,c,k,cnt=0; scanf("%d%d",&m,&n); for(int i=m;i<=n;i++) { k=i; a=k%10; b=k/10%10; c=k/100; if(a*a*a+b*b*b+c*c*c==i) { cnt++; cout << i << " "; } } if(cnt==0) { printf("no"); } return 0; }