Advertisement
smatskevich

Summ2

Feb 20th, 2021
738
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.21 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. int main() {
  4.   int n = 0;
  5.   std::cin >> n;
  6.  
  7.   int sum = 0;
  8.   for (int i = 0; i < n; ++i) {
  9.     int tmp;
  10.     std::cin >> tmp;
  11.     sum += tmp;
  12.   }
  13.   std::cout << sum;
  14.  
  15.   return 0;
  16. }
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement