Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
137131 何兴驰 12满足条件的四位数 C++ Compile Error 0 MS 0 KB 262 2025-11-16 11:52:05

Tests(0/0):


Code:

#include <bits/stdc++.h> using namespace std; int main(){ int n,a,num=0; cin>>n; for(int i=1;i<=n;i++){ cin>>a; int g=a%10; int q=a/1000; int s=a%100/10; int s=a%1000/100; if(g>s+b+q)num++ } cout<<num; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:11:9: error: redeclaration of 'int s'
     int s=a%1000/100;
         ^
Main.cc:10:9: note: 'int s' previously declared here
     int s=a%100/10;
         ^
Main.cc:12:12: error: 'b' was not declared in this scope
     if(g>s+b+q)num++
            ^
Main.cc:13:4: error: expected ';' before '}' token
    } 
    ^