I was just watching a video on youtube about an akm function and i tried to implement it.
I actually wrote a code and forgot to make spaces between the variables(for an easy reading), but the program didn't print anything but it kept on calculating.
I thought that a similar syntax would work just fine. Is there something I am doing wrong ?
Here is the code :
#include <bits/stdc++.h>
using namespace std;
int akm(int m,int n) {
if(m==0) return n+1;
else if(n==0) return akm(m-1,1);
else return akm(m-1 , akm(m,n-1));
}
int main() {
for(int i=0;i<6;i++)
for(int j=0;j<6;j++) {
cout<<i<<" "<<j ;
cout<<akm(i,j);
}
}