Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
70316 陈俊洁 13求n的阶乘 C++ Compile Error 0 MS 0 KB 188 2024-04-14 13:28:46

Tests(0/0):


Code:

#include <bits/stdc++.h> using namespace std; int main () { long long sum=1,n; cin>>n; if(n=0){ cout<<1; }else{ for(int i=1;i<=n;i++){ sum*=i } cout<<sum; } }


Run Info:

Main.cc: In function 'int main()':
Main.cc:6:8: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
  if(n=0){
        ^
Main.cc:11:2: error: expected ';' before '}' token
  } 
  ^