Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
90018 罗迎甲 13求n的阶乘 C++ Compile Error 0 MS 0 KB 191 2024-09-07 17:36:49

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main() { longlong n,k=1; cin>>n; if(n!=0){ for(int a=1;a<=n;a++) k=k*a; cout<<k; } else cout<<1; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:4:3: error: 'longlong' was not declared in this scope
 { longlong n,k=1;
   ^
Main.cc:5:7: error: 'n' was not declared in this scope
  cin>>n;
       ^
Main.cc:8:3: error: 'k' was not declared in this scope
   k=k*a;
   ^
Main.cc:9:9: error: 'k' was not declared in this scope
   cout<