你不会就好别回答好吗
//(c - b) % (b - a) == 0,b - A*a == c - A*b,两个条件都满足才可以
#include <stdio.h>
int main() {
int a,b,c;
int A,B;
printf("输入三个整数(q to quit):");
while(scanf("%d%d%d",&a,&b,&c) == 3) {
A = (c - b) / (b - a);
B = b - A*a;
if((c - b) % (b - a) || ((b - A*a) != (c - A*b)))
printf("Imposible!\n\n");
else {
printf("A = %d,B = %d\n",A,B);
printf("%d\n",A*c + B);
}
printf("输入三个整数(q to quit):");
}
return 0;
}