Python求助:为什么这样解只有80分,第7和第10个测试点RE
查看原帖
Python求助:为什么这样解只有80分,第7和第10个测试点RE
701049
Wwwwwww57楼主2023/1/18 23:21
from math import sqrt

a,b,c=map(float,input().split())
m=b*b-4*a*c
if a!=0:
   x1=((-b+sqrt(m))/(2*a))
   x2=((-b-sqrt(m))/(2*a))
   if m>=0:
       if m==0:
           print("x1=x2={:.5f}".format(x1))
       else:
           if x1<x2:
               print("x1={:.5f};x2={:.5f}".format(x1, x2))
           else:
               print("x1={:.5f};x2={:.5f}".format(x2, x1))
   elif m<0:
       print('No answer!')
2023/1/18 23:21
加载中...