#include <iostream>
#include <stdio.h>
using namespace std;
void funB(int n){
if (n>1){
cout<<n<<" ";
funA(n/2);
}
}
void funA(int m)
{
if (m>0){
cout<<m<<" ";
funB(m-1);
}
}
int main()
{
funA(20);
return 0;
}
对于此代码,我收到以下错误:
prog.cpp: In function ‘void funB(int)’:
prog.cpp:8:13: error: ‘funA’ was not declared in this scope
funA(n/2);
^
对于这个简单的间接递归示例,可能的错误是什么?我什至尝试改变函数的顺序。