- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
#include <default.inc>
var a:float=0.0;
var b:float=0.0;
var c:float=0.0;
var d:float=0.0;
var x1:float=0.0;
var x2:float=0.0;
::no
write 'Enter A: ';
in a;
write 'Enter B: ';
in b;
write 'Enter C: ';
in c;
write '$a*x^2+$b*x+c=0 [y/n]: ';
var s:string='';
string readline(s);
if eq(s, 'y') yes : no;
::yes
math d='b*b-4*a*c';
if eq(d, 0) dzero : dnzero;
if low(d, 0) dex;
::dzero
math x1='(-b)/(2*a)';
writeln 'X = $x1';
jump exit;
::dnzero
math x1='(-b+Math.sqrt(d))/(2*a)';
math x2='(-b-Math.sqrt(d))/(2*a)';
write 'X1 = $x1 X2 = $x2';
jump exit;
::dex
write 'Don`t exist!';
::exit
write 'Repeat? [y/n]';
string readline(s);
if eq(s, 'y') no;
write 'Bye!';
call readkey;