SHARE
TWEET

Untitled

a guest Jul 19th, 2019 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. int product(int a, int b) {
  5.     if(b == 0) {
  6.         return 0;
  7.     }
  8.     return a + product(a, b - 1);
  9. }
  10. int main()
  11. {
  12.     int a, b;
  13.     cin >> a >> b;
  14.     cout << product(a, b) << endl;
  15.     return 0;
  16. }
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