Advertisement
Guest User

Untitled

a guest
Dec 10th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.54 KB | None | 0 0
  1.   1 #include <stdio.h>
  2.   2 #include <math.h>
  3.   3
  4.   4 int main(void)
  5.   5 {
  6.   6
  7.   7     int test[] = {77,10};
  8.   8     int x = 2;
  9.   9     int y = 0;
  10.  10     int total = 0;
  11.  11     int new[2];
  12.  12
  13.  13     for (int i = 0; test[i] >= 0; i++)
  14.  14     {
  15.  15         test[i] = ((test[i] / 3) - 2);
  16.  16
  17.  17         if (test[i] > 0)
  18.  18         {
  19.  19
  20.  20             total += test[i];
  21.  21
  22.  22         }
  23.  23
  24.  24     }
  25.  25
  26.  26
  27.  27
  28.  28
  29.  29
  30.  30
  31.  31     printf("%d\n", total);
  32.  32
  33.  33
  34.  34
  35.  35     return 0;
  36.  36 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement