1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| #include <stdio.h> int main() { int x1 = 2, x2 = 0, x3 = -5, x4 = 8, i = 0; for (x1 = 2; x1 <= 35; x1++) { if (x1 + x2 + x3 + x4 == 30)i++; for (x2 = 0; x2 <= 35; x2++) { if (x1 + x2 + x3 + x4 == 30)i++; for (x3 = -5; x3 <= 35; x3++) { if (x1 + x2 + x3 + x4 == 30)i++; for (x4 = 8; x4 <= 35; x4++) { if (x1 + x2 + x3 + x4 == 30)i++; } } } } printf("%d", i);
return 0; }
|