Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
111846 | 谢佳辰 | 100~999的水仙花数 | C++ | Wrong Answer | 0 MS | 256 KB | 309 | 2025-03-07 14:21:39 |
#include <iostream> using namespace std; int main(){ int g,s,b,n,a; bool f=true; for(int i=100;i<1000;i++){ g=i%10; n=i; while(n!=0){ f=true; a=n%10; n=n/10; if(a!=g){ f=false; break; } } if(f==true){ cout<<i<<" "; } } return 0; }
------Input------
0
------Answer-----
153 370 371 407
------Your output-----
111 222 333 444 555 666 777 888 999