解答3

       real a, b, c
       real x1, x2
c
       read(5,*) a, b, c
       if( a .eq. 0.0 ) then
          x1 = - c / b
c
          write(6,*) 'x1 = ', x1
c
       else if( (b*b-4.0*a*c) .lt. 0.0 ) then
c
          write(6,*) '***** root is imaginary *****'
c
       else
          x1 = ( -b + sqrt( b*b - 4.0*a*c ))/ ( 2.0*a )
          x2 = ( -b - sqrt( b*b - 4.0*a*c ))/ ( 2.0*a )
c
          write(6,*) 'x1 = ', x1, ' x2 = ', x2
c
       end if
c
       end