Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //goo.gl/RGA6EX
- #include <iostream>
- #include <cmath>
- using namespace std;
- int sum() {
- int n;
- cin >> n;
- if (n == 0) {
- return n;
- }
- return n + sum();
- }
- int main() {
- cout << sum();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement