Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <algorithm>
- using namespace std;
- int zbir_od_1_do_n(int N) {
- int zbir = 0;
- for(int i = 1; i <= N; i++) {
- zbir += i;
- }
- return zbir;
- }
- int main()
- {
- int n;
- cin >> n;
- cout << zbir_od_1_do_n(n) << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement