Một số bài tập Pascal cơ bản - Phần 2
Chia sẻ bởi Nguyễn Thanh Dương |
Ngày 14/10/2018 |
54
Chia sẻ tài liệu: Một số bài tập Pascal cơ bản - Phần 2 thuộc Tin học 8
Nội dung tài liệu:
PHẦN 2
BT_02_01
Program ten_bien;
Begin
Writeln(`Ky tu : Ten bien khong duoc co khoang trong`);
Writeln(`$conso: Ten bien khong duoc co dau $ o dau`);
Writeln(`5so : Ten bien khong duoc co con so o dau`);
Writeln(`Do,Repeat: Khong duoc dung cac tu khoa de dat ten bien`);
Writeln;
Writeln(` Bam phim de ve cua so soan thao`);
Readln
End.
BT_02_02
Program tinh_luong;
Var
Ten:String[24];
bl,nc,pc,thang:Integer;
tl,hs:Real;
Begin
Writeln(`CHUONG TRINH TINH LUONG`);
Writeln(`-----------------------`);
Writeln;
Write(`-Cho biet thang : `);
Readln(thang);
Write(`-Cho biet ho ten : `);
Readln(ten);
Write(`-Cho biet bac luong : `);
Readln(bl);
Write(`-Cho biet ngay cong : `);
Readln(nc);
Write(`-Cho biet he so : `);
Readln(hs);
Write(`-Cho biet phu cap : `);
Readln(pc);
Writeln;
tl:=((bl/30)*nc*hs+pc);
Writeln(`+Tien luong thang : `,thang:2,`, cua Ong/Ba : `,ten,` la = `,tl:8:2);
Writeln(` Bam phim de ve cua so soan thao`);
Readln
End.
BT_02_03
Program Vong_tron;
Var
Radius,s,cv :Real;
Begin
Writeln(`TINH CHU VI, DIEN TICH VONG TRON`);
Writeln(`--------------------------------`);
Write(`-Cho biet ban kinh : `);
Readln(Radius);
cv:=2*Pi*Radius;
S:=Pi*Radius*Radius;
Writeln;
Writeln(`+Chu vi vong tron = `,cv:10:2);
Writeln(`+Dien tich vong tron = `,s:10:2);
Writeln;
Writeln(` Bam phim de tro ve cua so soan thao`);
Readln
End.
BT_02_04
Program Doi_do_F_C;
Var
f,c:Real;
Begin
Writeln(`DOI DO FAHRENHEIT SANG CELCIUS`);
Write(`-Cho biet do Fahrenheit : `);
Readln(f);
c:=((f-32) * 5)/9;
Writeln;
Writeln(f:5:2,` do Fahrenheit doi sang do Celcius = `,c:5:2,#248);
Writeln;
Writeln(` Bam phim de ket thuc`);
Readln
End.
BT_02_05
Program Doi_do_Mile_Km;
Const
Km_Mile=1.609344;
Var
m,k:Real;
Begin
Writeln(`DOI MILE SANG Km`);
Write(`-Cho biet so Mile can doi: `);
Readln(m);
k:=m * Km_Mile;
Writeln;
Writeln(m:5:2,` dam Anh doi thanh = `,k:5:2,` Km`);
Writeln;
Writeln(` Bam phim de ket thuc`);
Readln
End.
BT_02_06
Program Chu_so;
Var
n:longint;
Begin
Writeln(`XUAT CAC CHU SO CUA SO NGUYEN DUONG N`);
Write(`-Cho biet so nguyen: `);
Readln(n);
Writeln(`So nguyen: `,n:5,` Co cac chu so sau`);
Write(` `, n DIV 10000);
n :=n MOD 10000;
Write(` `, n DIV 1000);
n :=n MOD 1000;
Write(` `, n DIV 100);
n :=n MOD 100;
Write(` `, n DIV 10);
n :=n MOD 10;
Write(` `,n);
Writeln;
Writeln(` Bam phim de ket thuc`);
Readln
End.
BT_02_07
Program Cac_phep_toan;
Var
a,b,c
BT_02_01
Program ten_bien;
Begin
Writeln(`Ky tu : Ten bien khong duoc co khoang trong`);
Writeln(`$conso: Ten bien khong duoc co dau $ o dau`);
Writeln(`5so : Ten bien khong duoc co con so o dau`);
Writeln(`Do,Repeat: Khong duoc dung cac tu khoa de dat ten bien`);
Writeln;
Writeln(` Bam phim
Readln
End.
BT_02_02
Program tinh_luong;
Var
Ten:String[24];
bl,nc,pc,thang:Integer;
tl,hs:Real;
Begin
Writeln(`CHUONG TRINH TINH LUONG`);
Writeln(`-----------------------`);
Writeln;
Write(`-Cho biet thang : `);
Readln(thang);
Write(`-Cho biet ho ten : `);
Readln(ten);
Write(`-Cho biet bac luong : `);
Readln(bl);
Write(`-Cho biet ngay cong : `);
Readln(nc);
Write(`-Cho biet he so : `);
Readln(hs);
Write(`-Cho biet phu cap : `);
Readln(pc);
Writeln;
tl:=((bl/30)*nc*hs+pc);
Writeln(`+Tien luong thang : `,thang:2,`, cua Ong/Ba : `,ten,` la = `,tl:8:2);
Writeln(` Bam phim
Readln
End.
BT_02_03
Program Vong_tron;
Var
Radius,s,cv :Real;
Begin
Writeln(`TINH CHU VI, DIEN TICH VONG TRON`);
Writeln(`--------------------------------`);
Write(`-Cho biet ban kinh : `);
Readln(Radius);
cv:=2*Pi*Radius;
S:=Pi*Radius*Radius;
Writeln;
Writeln(`+Chu vi vong tron = `,cv:10:2);
Writeln(`+Dien tich vong tron = `,s:10:2);
Writeln;
Writeln(` Bam phim
Readln
End.
BT_02_04
Program Doi_do_F_C;
Var
f,c:Real;
Begin
Writeln(`DOI DO FAHRENHEIT SANG CELCIUS`);
Write(`-Cho biet do Fahrenheit : `);
Readln(f);
c:=((f-32) * 5)/9;
Writeln;
Writeln(f:5:2,` do Fahrenheit doi sang do Celcius = `,c:5:2,#248);
Writeln;
Writeln(` Bam phim
Readln
End.
BT_02_05
Program Doi_do_Mile_Km;
Const
Km_Mile=1.609344;
Var
m,k:Real;
Begin
Writeln(`DOI MILE SANG Km`);
Write(`-Cho biet so Mile can doi: `);
Readln(m);
k:=m * Km_Mile;
Writeln;
Writeln(m:5:2,` dam Anh doi thanh = `,k:5:2,` Km`);
Writeln;
Writeln(` Bam phim
Readln
End.
BT_02_06
Program Chu_so;
Var
n:longint;
Begin
Writeln(`XUAT CAC CHU SO CUA SO NGUYEN DUONG N`);
Write(`-Cho biet so nguyen: `);
Readln(n);
Writeln(`So nguyen: `,n:5,` Co cac chu so sau`);
Write(` `, n DIV 10000);
n :=n MOD 10000;
Write(` `, n DIV 1000);
n :=n MOD 1000;
Write(` `, n DIV 100);
n :=n MOD 100;
Write(` `, n DIV 10);
n :=n MOD 10;
Write(` `,n);
Writeln;
Writeln(` Bam phim
Readln
End.
BT_02_07
Program Cac_phep_toan;
Var
a,b,c
* 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ẻ: Nguyễn Thanh Dương
Dung lượng: 34,00KB|
Lượt tài: 1
Loại file: doc
Nguồn : Chưa rõ
(Tài liệu chưa được thẩm định)