#41376: python


suyueh (suyueh)

學校 : 不指定學校
編號 : 272111
來源 : [49.216.223.40]
最後登入時間 :
2024-09-07 15:48:59
a410. 解方程 -- TYVJ | From: [125.229.229.84] | 發表日期 : 2024-07-22 14:21

while True:
  try:
    a, b, c, d, e, f = map(int, input().split(' '))    
    if (a*e-d*b) != 0:    
      x = str(round((c*e-f*b)/(a*e-d*b),2))  
      y = str(round((a*f-d*c)/(a*e-d*b),2))
      if '.' in x:
        if len([i for i in x.split('.')][1])==1:
          x = x + '0'  
      else:
        x = x + '.00'
      if '.' in y:
        if len([i for i in y.split('.')][1])==1:
          y = y + '0'  
      else:
        y = y + '.00'

      print(f'x={x}')
      print(f'y={y}')
    else:              
      if (c*e-f*b) == 0 and (a*f-d*c) == 0:
        print('Too many')  
      else:
        print('No answer')
  except:
    break
 
ZeroJudge Forum