[ C++ ] Functia Ackerman - Tutoriale si exercitii - GAMELIFE România Jump to content

Recommended Posts

Posted
#include<iostream.h>
long long ack(long m, long n)
{
if (!m) return n+1;
else
if (!n) return ack(m-1,1);
else return ack(m-1, ack(m,n-1));
}

int main()
{
long long m,n;
cout<<"Introduceti prima cifra: ";
cin>>m;
cout<<"Introduceti al doilea numar: ";
cin>>n;
cout<<ack(m,n);
return 0;
}

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.


×
×
  • Create New...

Important Information