Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
146920 曾钰涵 100~999的水仙花数 C++ Compile Error 0 MS 0 KB 233 2026-02-01 12:07:29

Tests(0/0):


Code:

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


Run Info:

Main.cc: In function 'int main()':
Main.cc:7:15: error: 'i' was not declared in this scope
            a=(i/10)%10;
               ^