josiftepe

Untitled

Oct 25th, 2020
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.25 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int dolzina;
  8. cin>>dolzina;
  9. int y=0;
  10.  
  11.  
  12. int niza1 [dolzina];
  13.  
  14. for(int i=0; i<dolzina; i+=1){
  15.     cin>>niza1[i];
  16.       y+=niza1[i];
  17.        
  18. }
  19.     cout << y << endl;
  20.  
  21.  
  22.     return 0;
  23. }
  24.  
Advertisement
Add Comment
Please, Sign In to add comment