while True:
try:
a,b=map(int,input().split())
c,d=map(int,input().split())
if a==0 and b==0 and c==0 and d==0:
break
else:
D=abs(a*d-c*b)
if D==0:
print("cheat!")
else:
print("%.5f %.5f"%(-d/D,b/D))
print("%.5f %.5f"%(c/D,-a/D))
except EOFError:
break
while True:
try:
a,b=map(int,input().split())
c,d=map(int,input().split())
if a==0 and b==0 and c==0 and d==0:
break
else:
D=abs(a*d-c*b)
if D==0:
print("cheat!")
else:
print("%.5f %.5f"%(-d/D,b/D))
print("%.5f %.5f"%(c/D,-a/D))
except EOFError:
break
似乎是測資有問題,討論區有人說最後只有一個0。
另外反方陣不是這樣算的,網路找一下公式吧