Discuss / Python / 试试

试试

Topic source

李建樺ii

#1 Created at ... [Delete] [Delete and Lock User]

import math a = int(input ( '请输入a :')) b = int(input ( '请输入b :')) c = int(input ( '请输入c :')) def quadratic(a,b,c): delta = bb-4ac if delta < 0: return('方程无实根') else: return((-b+math.sqrt(bb-4ac))/(2a),(-b-math.sqrt(bb-4ac))/(2*a)) sol = quadratic(a, b, c) print('方程解为:', sol)


  • 1

Reply