Advertisement
Spocoman

07. Sum Numbers

Sep 6th, 2023
909
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     int numberCount;
  7.     cin >> numberCount;
  8.    
  9.     int number;
  10.  
  11.     int sum = 0;
  12.  
  13.     for (int i = 0; i < numberCount; i++) {
  14.         cin >> number;
  15.         sum += number;
  16.     }
  17.  
  18.     cout << sum << endl;
  19.  
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement