[r]
(1)////Đây chương trình Uses Crt ;
Var a, b, c, x1, x2: real;
(*================================*) Procedure Nhapabc(var aa,bb,cc: real);
Begin Write('a='); Readln(aa); Write('b='); Readln(bb); Write('c='); Readln(cc); End; (*=================================*) Procedure GPTB2;
Var Delta: real; Begin
Delta:=sqr(b)-4*a*c;
If Delta<0 then Writeln('Phuong trinh vo nghiem.') Else
If Delta=0 then Begin
Write('Phuong trinh co nghiem kep : '); Write('x1,2=',-b/(2*a):8:2); End Else Begin x1:=(-b+sqrt(Delta))/(2*a); x2:=(-b-sqrt(Delta))/(2*a);
Writeln('Phuong trinh co nghiem phan biet la :'); Writeln('X1=',x1:8:2, 'X2=',x2:8:2);
End; End;
(2)///////Bắt đầu chương trình BEGIN (* CT *)
Clrscr;
Writeln(' Giai Phuong Trinh Bac Hai Voi Cac He So :'); Nhapabc(a,b,c);
If a<>0 then GPTB2
Else Writeln(' Khong phai phuong trinh bac hai '); Readln ;