-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4efdf9e
commit 2d1979b
Showing
5 changed files
with
2,129 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 )); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ); | ||
} |
Oops, something went wrong.