Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
150786 赵奕杰 12满足条件的四位数 C++ Compile Error 0 MS 0 KB 224 2026-03-31 18:44:40

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ int n,a,g,s,b,q,cut=0; cin>>n; for(int i=1;i<=n;i++){ scanf("%1d%1d%1d%1d",&q,&b,&s,&g) if(g-q-b-s>0){ cut++; } } cout<<cut; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:8:3: error: expected ';' before 'if'
   if(g-q-b-s>0){
   ^
Main.cc:4:8: warning: unused variable 'a' [-Wunused-variable]
  int n,a,g,s,b,q,cut=0;
        ^
Main.cc:10:3: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   }
   ^