Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
138234 彭士宝 n的阶乘 C++ Compile Error 0 MS 0 KB 178 2025-11-23 20:19:45

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespacestd; int main(){ int n,x=0; cin>>n; for(int i=0;i<=n;i++){ x+=1; n=n*x; } cout<<n; return 0; }


Run Info:

Main.cc:2:7: error: expected nested-name-specifier before 'namespacestd'
 using namespacestd;
       ^
Main.cc: In function 'int main()':
Main.cc:5:5: error: 'cin' was not declared in this scope
     cin>>n;
     ^
Main.cc:5:5: note: suggested alternative:
In file included from /usr/include/x86_64-linux-gnu/c++/5/bits/stdc++.h:74:0,
                 from Main.cc:1:
/usr/include/c++/5/iostream:60:18: note:   'std::cin'
   extern istream cin;  /// Linked to standard input
                  ^
Main.cc:10:5: error: 'cout' was not declared in this scope
     cout<