Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
257 ZRH 05求百位数的每一位数之和 C++ Compile Error 0 MS 0 KB 367 2022-07-22 14:45:10

Tests(0/0):


Code:

#include<iostream> //输入函数库 #include<iomanip> #include<cmath> //数学函数库 #include<cstdio> #include<ctime> #include<cstring> #include<cstdlib> #include<string> #include<stdlib.h> #include<sys/time.h> using namespace std; int main(){ int a,b1,b2,b2; cin>>a; b1=a%10; b2=a/10%10; b3=a/100%10; cout<<b1+b2+b3; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:14:14: error: redeclaration of 'int b2'
  int a,b1,b2,b2;
              ^
Main.cc:14:11: error: 'int b2' previously declared here
  int a,b1,b2,b2;
           ^
Main.cc:18:2: error: 'b3' was not declared in this scope
  b3=a/100%10;
  ^