Skip to content

Commit

Permalink
initial upload
Browse files Browse the repository at this point in the history
  • Loading branch information
paulborile committed Apr 22, 2014
1 parent 4efdf9e commit 2d1979b
Show file tree
Hide file tree
Showing 5 changed files with 2,129 additions and 0 deletions.
14 changes: 14 additions & 0 deletions ack.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
int a;
main()
{
int x;
a = ack (3,12);
}


int ack ( int m , int n )
{
if ( m == 0 ) return ( n + 1 );
else if ( n == 0 ) return ack ( m - 1 , 1 );
else return ack ( m - 1 , ack ( m , n - 1 ));
}
29 changes: 29 additions & 0 deletions ack.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
class Ack {
public:
Ack();
~Ack();
int Run( int m , int n );
};

Ack::Ack()
{
}

Ack::~Ack()
{
}

int Ack::Run( int m , int n )
{
if ( m == 0 ) return ( n + 1 );
else if ( n == 0 ) return Run ( m - 1 , 1 );
else return Run ( m - 1 , Run ( m , n - 1 ));
}

int main()
{
int b;
Ack a;

b = a.Run ( 3 ,12 );
}
Loading

0 comments on commit 2d1979b

Please sign in to comment.