三元一次方程
#include <stdio.h>
int main() {
int count = 0;
for (int x = -30; x <= 30; x++) {
for (int y = -30; y <= 30; y++) {
for (int z = -30; z <= 30; z++) {
if (2 * x + 3 * y + 5 * z == 100) {
count++;
}
}
}
}
printf("%d\n", count);
return 0;
}
#include <stdio.h>
int main() {
int count = 0;
for (int x = -30; x <= 30; x++) {
for (int y = -30; y <= 30; y++) {
for (int z = -30; z <= 30; z++) {
if (2 * x + 3 * y + 5 * z == 100) {
count++;
}
}
}
}
printf("%d\n", count);
return 0;
}
相关推荐