Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
117142 刘珩宇 阿克曼函数 C++ Compile Error 0 MS 0 KB 475 2025-04-13 19:14:37

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 a(int x,int y){ if(m==0){ return n+1; } else if(m>0&&n==0){ return a(m-1,1); } else{ return a(m-1,a(m, n-1)); } } int main(){ int m,n; cin>>m>>n; cout<<a(m,n); return 0; }


Run Info:

Main.cc: In function 'int a(int, int)':
Main.cc:7:8: error: 'm' was not declared in this scope
     if(m==0){
        ^
Main.cc:8:16: error: 'n' was not declared in this scope
         return n+1;
                ^
Main.cc:10:18: error: 'n' was not declared in this scope
     else if(m>0&&n==0){
                  ^