Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int Func(int n)
- {
- if (n==1 || n<1)
- return 1;
- else
- return n+Func(n-1);
- }
- int main()
- { int m,k;
- cout << "m = "; cin >> m;
- cout << "k = "; cin >> k;
- cout<< Func(m)+Func(2*k)<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement