Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
150586 肖之睿 各个位数之和 C++ Compile Error 0 MS 0 KB 319 2026-03-28 20:34:11

Tests(0/0):


Code:

#include<iostream> using namespace std; int main(){ for(int i=1;i<=99999999;i++){ int a,b,c,d,e,f,g,h,i; a=i%10; b=i/10%10; c=i/100%10; d=i/1000%10; e=i/10000%10; f=i/100000%10; g=i/1000000%10; h=i/10000000%10; if(a+b+c+d+e+f+g+h==i){ cout<<i; } } return 0;


Run Info:

Main.cc: In function 'int main()':
Main.cc:6:23: error: redeclaration of 'int i'
   int a,b,c,d,e,f,g,h,i;
                       ^
Main.cc:5:10: note: 'int i' previously declared here
  for(int i=1;i<=99999999;i++){
          ^
Main.cc:19:10: error: expected '}' at end of input
  return 0;
          ^