SHARE
TWEET

LabExer6Prog3

a guest May 26th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std;
  3. int A(int m, int n);
  4.  
  5. int main()
  6. {
  7.     int x, y;
  8.     for (int i = 0; i < 7; i++)
  9.     {
  10.         cout << "Enter 2 numbers: ";
  11.         cin >> x >> y;
  12.         A(x, y);
  13.         cout << "A(" << x << ", " << y << ") = " << A(x, y) << endl;
  14.     }
  15.     system("pause>0");
  16. }
  17.  
  18. int A(int m, int n)
  19. {
  20.     if (m == 0)
  21.         return (n + 1);
  22.     else if (n == 0)
  23.         return (A(m - 1, 1));
  24.     else
  25.         return (A(m - 1, A(m, n - 1)));
  26. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top