Loi giai cho Bai tap tong hop Tin hoc 8

Chia sẻ bởi A Bon | Ngày 17/10/2018 | 41

Chia sẻ tài liệu: Loi giai cho Bai tap tong hop Tin hoc 8 thuộc Tin học 8

Nội dung tài liệu:

Program Bai1;
Uses Crt;
Var a,b,c,Max,min:Real;
Begin
Clrscr;
Write(`Nhap a,b,c = `);
Readln(a,b,c);
Max:=a; min:=a;
{So sanh 2 so a va b}
If a else min:=b;
{So sanh Max va min voi c}
If Max If min>c then min:=c;
{In ra man hinh ket qua}
Writeln(`So lon nhat la: `,Max:0:3);
Writeln(`So nho nhat la: `,min:0:3);
Readln;
End.

Program Bai2;
Uses Crt;
Var a,b,c,x:Real;
Begin
Clrscr;
Write(`Nhap vao 3 so thuc a,b,c = `);
Readln(a,b,c);
x:=abs(b-c); {Ham tinh gia tri tuyet doi}
If (a>0) and (b>0) and (c>0) then
Begin
If (a<(b+c)) and (a>x) then
write(`3 so nhap vao la 3 canh cua mot tam giac.`)
else
write(`3 so nhap vao khong phai 3 canh cua mot tam giac.`);
End
else
write(`3 so nhap vao khong phai 3 canh cua mot tam giac.`);
Readln;
End.

Program Bai3;
Uses Crt;
Var a,b,c,d,Max,min:Real;
Begin
Clrscr;
Write(`Nhap a,b,c,d = `);
Readln(a,b,c,d);
Max:=a; min:=a;
{So sanh 2 so a va b}
If a else min:=b;
{So sanh Max va min voi c}
If Max If min>c then min:=c;
{So sanh Max va min voi d}
If Max If min>d then min:=d;
{In ra man hinh ket qua}
Writeln(`So lon nhat la: `,Max:0:3);
Writeln(`So nho nhat la: `,min:0:3);
Readln;
End.

Program Bai4;
Uses Crt;
Var a,b,c,tb:Real;
Begin
Clrscr;
{Nhap vao theo thu tu diem 15ph, 1 tiet, thi hk}
Write(`Nhap a,b,c = `);
Readln(a,b,c);
tb:=((a+b*2)/3+c*2)/3;
If tb<4 then write(`khong dat.`)
else If tb<5.5 then write(`Dat.`)
else If tb<7 then write(`trung binh.`)
else If tb<8.5 then write(`Kha.`)
else write(`Gioi.`);
Readln;
End.

Program Bai4_Morong;
Uses Crt;
Var a,b,c,tb:Real;
Begin
Clrscr;
{Nhap vao theo thu tu diem 15ph, 1 tiet, thi hk co kiem tra dk diem >= 0}
REPEAT
Write(`Nhap a,b,c = `);
Readln(a,b,c);
If (a<0) or (b<0) or (c<0) then writeln(`Nhap sai, moi nhap lai!`);
UNTIL (a>=0) and (b>=0) and (c>=0);
tb:=((a+b*2)/3+c*2)/3;
If tb<4 then write(`khong dat.`)
else If tb<5.5 then write(`Dat.`)
else If tb<7 then write(`trung binh.`)
else If tb<8.5 then write(`Kha.`)
else write(`Gioi.`);
Readln;
End.

Program Bai5;
Uses Crt;
Var a:Integer;
Begin
Clrscr;
Write(`Nhap a = `); Readln(a);
CASE a OF
1
* Một số tài liệu cũ có thể bị lỗi font khi hiển thị do dùng bộ mã không phải Unikey ...

Người chia sẻ: A Bon
Dung lượng: 6,71KB| Lượt tài: 1
Loại file: rar
Nguồn : Chưa rõ
(Tài liệu chưa được thẩm định)