#7156: 此題line:1601 一直出現OLE，不了解為什麼?

akira0331 (小迷糊)

School : No School
ID : 26613
2013-07-29 09:30:29
d623. 反方陣 -- | From: [203.70.194.240] | Post Date : 2012-11-05 18:20

#include <stdio.h>

int main()
{
double a,b,c,d,tmp,det;
while(scanf("%lf %lf %lf %lf",&a,&b,&c,&d)!=EOF)
{
if(a==0&&b==0&&c==0&&d==0) break;
det=a*d-b*c;
if(det==0) printf("cheat!\n");
else
{
tmp=a; a=d; d=tmp;
b*=-1; c*=-1;
a/=det; b/=det;
c/=det; d/=det;
printf("%.5lf %.5lf\n",a,b);
printf("%.5lf %.5lf\n",c,d);
}
}
return 0;
}

#7157: Re:此題line:1601 一直出現OLE，不了解為什麼?

akira0331 (小迷糊)

School : No School
ID : 26613
2013-07-29 09:30:29
d623. 反方陣 -- | From: [203.70.194.240] | Post Date : 2012-11-05 18:33

#include

int main()
{
double a,b,c,d,tmp,det;
while(scanf("%lf %lf %lf %lf",&a,&b,&c,&d)!=EOF)
{
if(a==0&&b==0&&c==0&&d==0) break;
det=a*d-b*c;
if(det==0) printf("cheat!\n");
else
{
tmp=a; a=d; d=tmp;
b*=-1; c*=-1;
a/=det; b/=det;
c/=det; d/=det;
printf("%.5lf %.5lf\n",a,b);
printf("%.5lf %.5lf\n",c,d);
}
}
return 0;
}

#16170: Re:此題line:1601 一直出現OLE，不了解為什麼?

giant0620 (BlenderWang)

School : 國立彰化師範大學
ID : 61100
2022-07-25 14:26:46
d623. 反方陣 -- | From: [118.163.203.105] | Post Date : 2018-12-01 16:15

#include

int main()
{
double a,b,c,d,tmp,det;
while(scanf("%lf %lf %lf %lf",&a,&b,&c,&d)!=EOF)
{
if(a==0&&b==0&&c==0&&d==0) break;
det=a*d-b*c;
if(det==0) printf("cheat!\n");
else
{
tmp=a; a=d; d=tmp;
b*=-1; c*=-1;
a/=det; b/=det;
c/=det; d/=det;
printf("%.5lf %.5lf\n",a,b);
printf("%.5lf %.5lf\n",c,d);
}
}
return 0;
}

ZeroJudge Forum