#24420: py ans


k227399@gmail.com (cw4real)


 

  1. 宣告t的變數
  2. 使用while迴圈來規定行數
  3. 在回圈內input 4個變數
  4. 用if else 判斷 等差 還是 等比
  5. 記得回圈內 t=t-1 否則會無限迴圈

t=int(input())

while ( t > 0 ):

    a,b,c,d=map(int,input().split())

    if (d-c == c-b): print(a,b,c,d,b-a+d,"\n")

    else:

        print(a,b,c,d,d*b/a,"\n")

        t=t-1