josiftepe

Untitled

Jan 27th, 2021
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.  
  6.     int n;
  7.     cin >> n;
  8.     // sme vnele n
  9.    
  10.     // treba da vneseme n broevi
  11.     int broj;
  12.     int zbir = 0;
  13.     for(int i = 1; i <= n; i += 1) { // gi izminuvame site broevi od 1 do n
  14.         cin >> broj;
  15.         zbir += broj;
  16.     }
  17.     cout << zbir << endl;
  18.     return 0;
  19. }
  20. //
  21.  
Advertisement
Add Comment
Please, Sign In to add comment