Advertisement
Guest User

Untitled

a guest
Dec 10th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.31 KB | None | 0 0
  1. #define _CRT_SECURE_NO_WARNINGS
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. void main()
  6. {
  7.     int a[16] = { 2, 1, -27, 3, 35, 7, -71, 4, 0, 12, -5, -7, 3, 0, 5, 14 };
  8.     int s=0,ser;
  9.    
  10.     for (int i = 0; i < 16; i++){
  11.         if (a[i]>-5) s+= a[i];
  12.  
  13.    
  14.     }
  15.     printf("%.2d\n", s);
  16.     ser = s / 16;
  17.     printf("%.2d\n", ser);
  18.  
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement