a410.
解方程
--
TYVJ
| From: [111.184.39.89] |
發表日期
:
2015-02-09 21:41
它告訴我:
第 5 測資點(0%): WA (line:1) 答案不正確您的答案為: x=-inf 正確答案為: x=-0.33 我不懂那個-inf是什麼意思,我到底哪理錯了,請各位大大告訴我,謝謝。 下面是我的程式碼
#include <stdio.h>
int main()
{
double a , b , c , d , e , f;
while(scanf("%lf %lf %lf %lf %lf %lf" , &a , &b , &c , &d , &e , &f) != EOF)
{
double x , y;
if(((b * d) - (a * e)) == 0 && ((d * c) - (a * f)) == 0)
{
printf("Too many\n");
}
else if(((b * d) - (a * e)) == 0 && ((d * c) - (a * f)) != 0)
{
printf("No answer\n");
}
else
{
y = ((d * c) - (a * f)) / ((b * d) - (a * e));
x = (c - (b * y)) / a;
printf("x=%.2lf\n" , x);
printf("y=%.2lf\n" , y);
}
}
return 0;
}