Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
130337 李亭绪 12满足条件的四位数 C++ Compile Error 0 MS 0 KB 225 2025-09-11 19:57:36

Tests(0/0):


Code:

#include <iostream> using namespace st; int main(){ int n,a,i,g,s,b,q; int SUM=0; cin>>n; for(i=0;i<n;i++){ cin>>a; g=a%10; s=(a/10)%10; b=(a/100)%10; q=(a/1000)%10; if(g-q-b-s>0){ SUM++;} cout << SUM << endl;}}


Run Info:

Main.cc:2:17: error: 'st' is not a namespace-name
 using namespace st;
                 ^
Main.cc:2:19: error: expected namespace-name before ';' token
 using namespace st;
                   ^
Main.cc: In function 'int main()':
Main.cc:6:1: error: 'cin' was not declared in this scope
 cin>>n;
 ^
Main.cc:6:1: note: suggested alternative:
In file included from Main.cc:1:0:
/usr/include/c++/5/iostream:60:18: note:   'std::cin'
   extern istream cin;  /// Linked to standard input
                  ^
Main.cc:15:1: error: 'cout' was not declared in this scope
 cout << SUM << endl;}}
 ^
Main.cc:15:1: note: suggested alternative:
In file included from Main.cc:1:0:
/usr/include/c++/5/iostream:61:18: note:   'std::cout'
   extern ostream cout;  /// Linked to standard output
                  ^
Main.cc:15:16: error: 'endl' was not declared in this scope
 cout << SUM << endl;}}
                ^
Main.cc:15:16: note: suggested alternative:
In file included from /usr/include/c++/5/iostream:39:0,
                 from Main.cc:1:
/usr/include/c++/5/ostream:590:5: note:   'std::endl'
     endl(basic_ostream<_CharT, _Traits>& __os)
     ^