#31278: python不清楚問題,也不知道怎麼改


bowon.lin@gmail.com (柏宇練習中)

學校 : 不指定學校
編號 : 114462
來源 : [124.218.17.159]
最後登入時間 :
2022-08-09 09:16:44

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
#31313: Re: python不清楚問題,也不知道怎麼改


cges30901 (cges30901)

學校 : 不指定學校
編號 : 30877
來源 : [39.12.66.21]
最後登入時間 :
2025-04-20 17:19:22

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。

另外反方陣不是這樣算的,網路找一下公式吧