Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
6173 吴承熹 100~999的水仙花数 C++ Accepted 0 MS 252 KB 273 2025-01-11 09:53:13

Tests(1/1):


Code:

#include<iostream> using namespace std; int main(){ int n=100,a=0,b=0,c=0,d=0; for(int i=n;i<=999;i++){ a=i/1%10; b=i/10%10; c=i/100%10; if(a*a*a+b*b*b+c*c*c==i){ cout<<i<<" "; } } return 0; }