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