具有用户输入的二次方程求解器
/** n o w j a v a . c o m 提供 **/ import java.util.Scanner; public class Main { public static void main(String[] arg) { Scanner keyboard = new Scanner(System.in); System.out.print("Enter a,b,c of equation ax^2+bx+c=0:"); double a = keyboard.nextDouble(); double b = keyboard.nextDouble(); double c = keyboard.nextDouble(); double delta = b * b - 4.0 * a * c; double root1, root2; /** 时代Java - nowjava.com 提 供 **/ if (delta >= 0) { root1 = (-b - Math.sqrt(delta)) / (2.0 * a); root2 = (-b + Math.sqrt(delta)) / (2.0 * a); System.out.println(