Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
106899 | 陈骏睿 | 100~999的水仙花数 | C++ | Accepted | 1 MS | 264 KB | 431 | 2025-01-17 09:26:24 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int a,b,c,n; for(n=100;n<=999;n++){ c=n%10; b=n/10%10; a=n/100; if(a*a*a+b*b*b+c*c*c==n){ cout<<n<<endl; } } return 0; }