Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
117146 吴诗涵 阿克曼函数 C++ Compile Error 0 MS 0 KB 494 2025-04-13 19:16:05

Tests(0/0):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int out(int m,int n){ if(m=0){ return out(m,n)=n+1; } else if(m>0,n=0){ return out(m,n)=out(m-1,1) } else if(m,n>0){ return out(m,n)=out(m-1,out(m, n-1)) } } int main(){ long long n,v; cin>>n>>v; cout<<out(n,v); return 0; }


Run Info:

Main.cc: In function 'int out(int, int)':
Main.cc:8:7: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
 if(m=0){
       ^
Main.cc:9:20: error: lvalue required as left operand of assignment
     return out(m,n)=n+1;
                    ^
Main.cc:11:10: warning: left operand of comma operator has no effect [-Wunused-value]
 else if(m>0,n=0){
          ^
Main.cc:12:20: error: lvalue required as left operand of assignment
     return out(m,n)=out(m-1,1)
                    ^
Main.cc:13:1: error: expected ';' before '}' token
 }
 ^
Main.cc:14:13: warning: left operand of comma operator has no effect [-Wunused-value]
 else if(m,n>0){
             ^
Main.cc:15:20: error: lvalue required as left operand of assignment
     return out(m,n)=out(m-1,out(m, n-1))
                    ^
Main.cc:16:1: error: expected ';' before '}' token
 }
 ^