Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int A(int m, int n);
- int main()
- {
- int x, y;
- for (int i = 0; i < 7; i++)
- {
- cout << "Enter 2 numbers: ";
- cin >> x >> y;
- A(x, y);
- cout << "A(" << x << ", " << y << ") = " << A(x, y) << endl;
- }
- system("pause>0");
- }
- int A(int m, int n)
- {
- if (m == 0)
- return (n + 1);
- else if (n == 0)
- return (A(m - 1, 1));
- else
- return (A(m - 1, A(m, n - 1)));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement