PROGRAM ax2bxc
  IMPLICIT NONE

  DOUBLE PRECISION :: a,b,c, diakrinousa

  PRINT *, "Dwse toys syntelestes a,b,c ths ax^2+bx+c=0"
  READ *, a, b, c


  IF (a == 0.0d0) THEN
     IF (b == 0.0d0) THEN
        IF (c == 0.0d0) THEN 
           PRINT *, "H eksiswsh exei apeires lyseis"
        ELSE
           PRINT *, "H eksiswsh den exei lysh"
        END IF
     ELSE
        PRINT *, "H eksiswsh exei mia diplh lysh, thn" , -c/b
     ENDIF
  ELSE   ! a /= 0
     diakrinousa = b*b -4*a*c

     IF (diakrinousa == 0.0d0) THEN
        PRINT *, "H eksiswsh exei mia diplh lysh, thn" , -b/(2.0d0*a)
     ENDIF

     IF (diakrinousa > 0.0d0) THEN
           PRINT *, "H eksiswsh exei dyo lyseis, tis" , &
                (-b+SQRT(diakrinousa))/(2.0d0*a),   &
                (-b-SQRT(diakrinousa))/(2.0d0*a)  
     ENDIF
 
     IF (diakrinousa < 0.0d0) THEN
           PRINT *, "oi lyseis einai migadikes"
     ENDIF
  ENDIF

END PROGRAM ax2bxc
