Advertisement
Josif_tepe

Untitled

Jan 26th, 2024
520
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.17 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main() {
  4.     int n;
  5.     cin >> n;
  6.    
  7.     int zbir = n * (n + 1) / 2;
  8.     cout << zbir << endl;
  9.    
  10.     return 0;
  11. }
  12.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement