tìm min max của 3 số a,b,c pascal giải hộ mình với

tìm min max của 3 số a,b,c pascal
giải hộ mình với

0 bình luận về “tìm min max của 3 số a,b,c pascal giải hộ mình với”

  1. Program BTT;
    Uses crt;
    Var a,b,c: longint;
    Begin
            Clrscr;
            Write(‘Nhap 3 so a, b, c: ‘); Readln(a, b, c);
            If (a>b) and (a>c) then Write(a,’ lon nhat’);
            If (b>a) and (b>c) then Write(b,’ lon nhat’);
            If (c>a) and (c>b) then Write(c,’ lon nhat’);
            Writeln;
            If (a<c) and (a<b) then Write(a,’ nho nhat’);
            If (b<c) and (b<a) then Write(b,’ nho nhat’);
            If (c<a) and (c<b) then Write(c,’ nho nhat’);
            Readln
    End.

    Bình luận
  2. program tim_min_max;
    uses crt;
    var a,b,c:real;
    max,min:real;
    begin
    clrscr;
    write(‘nhap so thu nhat:’); readln(a);
    write(‘nhap so thu hai:’); readln(b);
    write(‘nhap so thu ba:’); readln(c);
    max:=a;
    if b>max then max:=b;
    if c>max then max:=c;
    writeln(‘Gia tri lon nhat la:’,max:4:0);
    readln;
    min:=a;
    if b<min then min:=b;
    if c<min then min:=c;
    writeln(‘Gia tri nho nhat la: ‘,min:4:0);
    readln;
    end.

    tim-min-ma-cua-3-so-a-b-c-pascal-giai-ho-minh-voi

    Bình luận

Viết một bình luận