#include<stdio.h>
int main() {
double a, b, c, d, val;
scanf("%lf %lf %lf %lf", &a, &b, &c, &d);
while(a != 0 || b != 0 || c != 0 || d != 0) {
val = a*d - b*c;
if(val == 0) {
printf("cheat!\n");
}
else {
printf("%.5lf %.5lf\n%.5lf %.5lf\n", d/val, -b/val, -c/val, a/val);
}
scanf("%lf %lf %lf %lf", &a, &b, &c, &d);
}
return 0;
}
以上,手動輸入測資的話沒問題,但submit後就TLE了
到底為什麼呢?