Advertisement
Guest User

Untitled

a guest
Dec 10th, 2019
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.61 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 total = 0;
  9.   9     int i = 0;
  10.  10
  11.  11     while (test[i] >= 0)
  12.  12     {
  13.  13         test[i] = ((test[i] / 3) - 2);
  14.  14         total += test[i];
  15.  15
  16.  16         if (test[i] > 0)
  17.  17         {
  18.  18             for (i = 0; i < 2; i++)
  19.  19             {
  20.  20                 test[i] = ((test[i] / 3) - 2);
  21.  21                 total += test[i];
  22.  22         }   }
  23.  23         i++;
  24.  24     }
  25.  25
  26.  26
  27.  27
  28.  28     printf("%d\n", total);
  29.  29
  30.  30
  31.  31
  32.  32     return 0;
  33.  33 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement