#10264: 嚴重懷疑測資最後面根本沒有四個 0

#### axs (我沒AC)

School : 臺北市立大理高級中學
ID : 33142
IP address : [114.45.218.50]
2016-08-03 22:44:54
d623. 反方陣 -- | From: [140.118.138.79] | Post Date : 2015-09-22 12:17

#include <stdio.h>

int main() {

int a, b, c, d;

while(1) {

scanf("%d%d%d%d", &a, &b, &c, &d);

if (a==0 && b==0 && c==0 && d==0)break;

float D = a*d - b*c;

if (D==0)

printf("cheat!");

else

printf("%.5f %.5f\n%.5f %.5f\n", d/D, -b/D, -c/D, a/D);

}

}

#10269: Re:嚴重懷疑測資最後面根本沒有四個 0

#### prisoner (prisoner)

School : No School
ID : 51782
IP address : [208.58.75.181]
2015-10-02 07:28:18
d623. 反方陣 -- | From: [208.58.75.181] | Post Date : 2015-09-22 21:27

#include

int main() {

int a, b, c, d;

while(1) {

scanf("%d%d%d%d", &a, &b, &c, &d);

if (a==0 && b==0 && c==0 && d==0)break;

float D = a*d - b*c;

if (D==0)

printf("cheat!"); // <---------------------------missing new line.  That is why TLE

else

printf("%.5f %.5f\n%.5f %.5f\n", d/D, -b/D, -c/D, a/D);

}

}

#12379: Re:嚴重懷疑測資最後面根本沒有四個 0

#### kirksud (KirkSuD)

School : 臺北市立麗山高級中學
ID : 66737
IP address : [140.115.208.111]
2019-12-30 22:09:01
d623. 反方陣 -- | From: [180.217.187.255] | Post Date : 2017-07-17 23:00

#include<stdio.h>

int main(){

int a,b,c,d;

double e;

while (scanf("%d%d%d%d",&a,&b,&c,&d)==4){

e = a*d - b*c;

if (a==0&&b==0&&c==0&&d==0){

printf("4 0\n");

}

if (e!=0){

printf("%.5f %.5f\n%.5f %.5f\n",d/e,-b/e,-c/e,a/e);

}

else{printf("cheat!\n");}

}

return 0;

}

#13915: Re:嚴重懷疑測資最後面根本沒有四個 0

#### a0984030252@gmail.com (作者)

School : 國立基隆高級中學
ID : 72711
IP address : [49.159.170.191]
2020-01-29 19:26:44
d623. 反方陣 -- | From: [111.250.7.202] | Post Date : 2018-05-15 11:09

#include

int main() {

int a, b, c, d;

while(1) {

scanf("%d%d%d%d", &a, &b, &c, &d);

if (a==0 && b==0 && c==0 && d==0)break;

float D = a*d - b*c;

if (D==0)

printf("cheat!");

else

printf("%.5f %.5f\n%.5f %.5f\n", d/D, -b/D, -c/D, a/D);

}

}

while 不能用 1來限制==＿

#16172: Re:嚴重懷疑測資最後面根本沒有四個 0

#### giant0620 (BlenderWang)

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

#include

int main() {

int a, b, c, d;

while(1) {

scanf("%d%d%d%d", &a, &b, &c, &d);

if (a==0 && b==0 && c==0 && d==0)break;

float D = a*d - b*c;

if (D==0)

printf("cheat!");

else

printf("%.5f %.5f\n%.5f %.5f\n", d/D, -b/D, -c/D, a/D);

}

}

while 不能用 1來限制==＿

if (a==0 && b==0 && c==0 && d==0)break;

ZeroJudge Forum