Advertisement
Josif_tepe

Untitled

Aug 21st, 2023
647
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.35 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. int main(int argc, const char * argv[]) {
  4.     int n;
  5.     scanf("%d", &n);
  6.    
  7.     int niza[n];
  8.    
  9.     for(int i = 0; i < n; i++) {
  10.         scanf("%d", &niza[i]);
  11.     }
  12.    
  13.     int zbir = 0;
  14.     for(int i = 0; i < n; i++) {
  15.         zbir += niza[i];
  16.     }
  17.     printf("%d\n", zbir);
  18.     return 0;
  19. }
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement