Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

ptb2

class QuadEq {
    static void main (String[] args){
        def a = System.in.newReader().readLine()
        def b = System.in.newReader().readLine()
        def c = System.in.newReader().readLine()
        print "${a} ${b} ${c}"
    }
}
        
        /*if (a == 0){
            print "x = " +  -c/b 
        }
        
        def delta = Math.pow(b,2) - 4*a*c
        
        if (delta < 0){
            print "no real root"
        }
        else if (delta == 0){
            def x = -b/(2*a)
            print "x1 = x2 = " +x
            
        }
        else{
        def x1 = ((-b + Math.sqrt(delta))/(2*a))
        def x2 = ((-b - Math.sqrt(delta))/(2*a))
        
        print "x1 = " +x1 + "  " + "x2 = " +x2
        }

    }
}
*/

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.