Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
115256 | 范恒恺 | 100~999的水仙花数 | C++ | Wrong Answer | 0 MS | 264 KB | 272 | 2025-03-30 08:33:55 |
#include<bits/stdc++.h> using namespace std; int main(){ int a,b,c,d,sum=0; for(int i=100 ;i<=999;i++){ d=i%10; c=i/10%10; b=i/100%100; if(d*d*d+c*c*c+b*b*b==i){ sum++; //cout<<d<<" "<<c<<" "<<b <<" "<<i<<endl; } }cout<<sum; return 0; }
------Input------
0
------Answer-----
153 370 371 407
------Your output-----
4