Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
158869 谭鑫哲 100~999的水仙花数 C++ Accepted 1 MS 260 KB 459 2026-08-23 09:19:26

Tests(1/1):


Code:

#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 x=100,b,s,g; while(x<=999){ b=x/100; s=x/10%10; g=x%10; if(b*b*b+s*s*s+g*g*g==x){ cout<<x<<" "; } x++; } return 0; }