4 a, b, c, xre, xim: real;
\r
10 writeln( ' aX + bX + c = 0' );
\r
11 write( 'Ingrese a: ' );
\r
13 write( 'Ingrese b: ' );
\r
15 write( 'Ingrese c: ' );
\r
17 IF ( sqr( b ) - 4 * a * c ) < 0 THEN xim := abs( sqr( b ) - 4 * a * c ) / ( 2 * a )
\r
18 ELSE xre := ( sqr( b ) - 4 * a * c ) / ( 2 * a );
\r
19 IF xre <> -1 THEN writeln( 'X1 = ' , ( ( -b ) / ( 2 * a ) ) + xre : 3 : 2 , ' X2 = ' , ( ( -b ) / ( 2* a ) ) - xre : 3 : 2 )
\r
20 ELSE IF xim <> -1 THEN writeln( 'X1 = ' , ( -b ) / ( 2 * a ) : 3 : 2 , ' + ' , xim : 3 : 2 , 'i X2 = ' , ( -b ) / ( 2* a ) : 3 : 2 , ' - ' , xim : 3 : 2 , 'i' )
\r
21 ELSE writeln( 'Hubo un error.' );
\r