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