Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int f(int m, int n)
- {
- if (m == n) return n*n;
- else return m*m + f(m + 1, n);
- }
- int main()
- {
- int m,n;
- cout << "Unesi m i n: ";
- cin >> m>>n;
- cout << "SUMA od m-n = " << f(m,n);
- system("pause >nul");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment