題目

解答

1
2
3
4
5
6
7
8
9
10
11
a,b,c = map(int,input().split())

if b**2-4*a*c>0:
x1 = int((-b+(b**2-4*a*c)**0.5)//(2*a))
x2 = int((-b-(b**2-4*a*c)**0.5)//(2*a))
print('Two different roots x1='+str(x1)+' , '+'x2='+str(x2))
elif b**2-4*a*c==0:
x1 = int((-1*b+(b**2-4*a*c)**0.5)//(2*a))
print('Two same roots x='+str(x1))
elif b**2-4*a*c<0:
print('No real root')