Advertisement
jordanov

zadaca 2 #nizi

Dec 7th, 2015
350
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.34 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.     int x;
  7.     int n;
  8.     int i;
  9.     int a[100];
  10.     int zbir;
  11.  
  12.     scanf("%d", &n);
  13.     for(i=0;i<n;i++)
  14.     {
  15.         scanf("%d", &x);
  16.         a[i] = x;
  17.     }
  18.     zbir = 0;
  19.     for(i=0;i<n;i++)
  20.     {
  21.         zbir += a[i];
  22.     }
  23.  
  24.     printf("%d", zbir);
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement