public class wu{ public static void main(String[] args){ int a = 2,b = 1, c = 0,d = b*b-4*a*c if (a == 0){ System.out.println("不是一元二次方程"); } else if(a != 0){ if (d > 0){ System.out.println("有两个不等实根"); } else if(d == 0){ System.out.println("有两个相等实根"); } else{ System.out.println("无实根"); } } } }