Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
121861 鲁博睿 100~999的水仙花数 C++ Accepted 0 MS 264 KB 279 2025-06-08 16:27:49

Tests(1/1):


Code:

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