if else练习 (解一元二次方程)

public class cccc {

    /**
     * @param args
     */
    public static void main(String[] args) {
    
int a=10,b=11,c=12,d=b*b-4*a*c;
if(a==0){
    
System.out.println("无值");
    
}
else
{
if(d>0)
{System.out.println("有两个不相等的实根");}    

else if(d==0)
{System.out.println("有两个相等的实根");}
else
{System.out.println("没有实根");}
    





}
     

    
    
    
    
    
    
        
        
        
    
        
    
    
    
        
    
        
        
        
        

        // TODO 自动生成的方法存根
}
    }
原文地址:https://www.cnblogs.com/Chenshuai7/p/5018349.html