Bài tập Pascal hay
Chia sẻ bởi Lê Huỳnh |
Ngày 16/10/2018 |
62
Chia sẻ tài liệu: Bài tập Pascal hay thuộc Lịch sử 6
Nội dung tài liệu:
Bài 1
Program Ca_dao;
Begin
Writeln(`Trong dam gi dep bang sen,`);
Writeln(`La xanh bong trang lai chen nhi vang,`);
Writeln(`Nhi vang bong trang la xanh.`);
Writeln(`Gan bun ma chang hoi tanh mui bun`);
Readln
End.
bài 2
Program Tam_giac;
Begin
Writeln(`*********`);
Writeln(` *******`);
Writeln(` *****`);
Writeln(` ***`);
Writeln(` *`);
Readln
End.
Bài 3
Program Phep_Tru;
Var
so1,so2,hieu :Integer;
Begin
Writeln(` CHUONG TRINH THUC HIEN PHEP TRU SO HOC`);
Writeln(` co toi da 4 ky so`);
Write(`-Nhap so thu nhat = `);
Readln(so1);
Write(`-Nhap so thu hai = `);
Readln(so2);
hieu:= so1-so2;
Writeln;
Writeln;
Writeln(`-------------------------------`);
Writeln;
Writeln(` `,so1:4);
Writeln(` - `,so2:4);
Writeln(` -----`);
Writeln(` = `,hieu:5);
Readln
End.
Bài 4
Program Cuu_chuong_1;
Var
so :Integer;
Begin
Write(`-Bang cuu chuong so may ?: `);
Readln(so);
Writeln;
Writeln;
Writeln(` CHUONG TRINH BANG CUU CHUONG`);
Writeln(`-------------------------------`);
Writeln;
Writeln(so:2,` lan 1 = `,so*1:3);
Writeln(so:2,` lan 2 = `,so*2:3);
Writeln(so:2,` lan 3 = `,so*3:3);
Writeln(so:2,` lan 4 = `,so*4:3);
Writeln(so:2,` lan 5 = `,so*5:3);
Writeln(so:2,` lan 6 = `,so*6:3);
Writeln(so:2,` lan 7 = `,so*7:3);
Writeln(so:2,` lan 8 = `,so*8:3);
Writeln(so:2,` lan 9 = `,so*9:3);
Writeln(so:2,` lan 10 = `,so*10:3);
Readln
End.
Bài 5
Program Cuu_chuong_2;
Var
so,i :Integer;
Begin
Write(`-Bang cuu chuong so may ?: `);
Readln(so);
Writeln;
Writeln;
Writeln(` CHUONG TRINH BANG CUU CHUONG`);
Writeln(`-------------------------------`);
Writeln;
For i:=1 To 10 Do
Writeln(so:2,` lan `,i:2,` = `,so*i:3);
Readln
End.
Bài 6
Program Hinh_thang;
Var
a,b,h:Integer;
S:Real;
Begin
Writeln(`CHUONG TRINH TINH DIEN TICH HINH THANG`);
Write(`-Cho biet day ngan = `);
Readln(a);
Write(`-Cho biet day dai = `);
Readln(b);
Write(`-Cho biet chieu cao = `);
Readln(h);
S := 0.5 * (a + b) * h;
Writeln(`+Dien tich hinh thang = `,s:6:2,` met vuong`);
Readln
End.
Bài 7
Program Tam_Giac;
Var
a,b,c:Integer;
p,s:Real;
Begin
Writeln(`CHUONG TRINH TINH DIEN TICH TAM GIAC`);
Write(`-Cho biet canh thu nhat = `);
Readln(a);
Write(`-Cho biet canh thu hai = `);
Readln(b);
Write(`-Cho biet canh thu ba = `);
Readln(c);
p := 0.5 * (a + b + c);
s := sqrt(p*(p-a)*(p-c)*(p-c));
Writeln(`+Dien tich hinh tam giac = `,s:6:2,` met vuong`);
Program Ca_dao;
Begin
Writeln(`Trong dam gi dep bang sen,`);
Writeln(`La xanh bong trang lai chen nhi vang,`);
Writeln(`Nhi vang bong trang la xanh.`);
Writeln(`Gan bun ma chang hoi tanh mui bun`);
Readln
End.
bài 2
Program Tam_giac;
Begin
Writeln(`*********`);
Writeln(` *******`);
Writeln(` *****`);
Writeln(` ***`);
Writeln(` *`);
Readln
End.
Bài 3
Program Phep_Tru;
Var
so1,so2,hieu :Integer;
Begin
Writeln(` CHUONG TRINH THUC HIEN PHEP TRU SO HOC`);
Writeln(` co toi da 4 ky so`);
Write(`-Nhap so thu nhat = `);
Readln(so1);
Write(`-Nhap so thu hai = `);
Readln(so2);
hieu:= so1-so2;
Writeln;
Writeln;
Writeln(`-------------------------------`);
Writeln;
Writeln(` `,so1:4);
Writeln(` - `,so2:4);
Writeln(` -----`);
Writeln(` = `,hieu:5);
Readln
End.
Bài 4
Program Cuu_chuong_1;
Var
so :Integer;
Begin
Write(`-Bang cuu chuong so may ?: `);
Readln(so);
Writeln;
Writeln;
Writeln(` CHUONG TRINH BANG CUU CHUONG`);
Writeln(`-------------------------------`);
Writeln;
Writeln(so:2,` lan 1 = `,so*1:3);
Writeln(so:2,` lan 2 = `,so*2:3);
Writeln(so:2,` lan 3 = `,so*3:3);
Writeln(so:2,` lan 4 = `,so*4:3);
Writeln(so:2,` lan 5 = `,so*5:3);
Writeln(so:2,` lan 6 = `,so*6:3);
Writeln(so:2,` lan 7 = `,so*7:3);
Writeln(so:2,` lan 8 = `,so*8:3);
Writeln(so:2,` lan 9 = `,so*9:3);
Writeln(so:2,` lan 10 = `,so*10:3);
Readln
End.
Bài 5
Program Cuu_chuong_2;
Var
so,i :Integer;
Begin
Write(`-Bang cuu chuong so may ?: `);
Readln(so);
Writeln;
Writeln;
Writeln(` CHUONG TRINH BANG CUU CHUONG`);
Writeln(`-------------------------------`);
Writeln;
For i:=1 To 10 Do
Writeln(so:2,` lan `,i:2,` = `,so*i:3);
Readln
End.
Bài 6
Program Hinh_thang;
Var
a,b,h:Integer;
S:Real;
Begin
Writeln(`CHUONG TRINH TINH DIEN TICH HINH THANG`);
Write(`-Cho biet day ngan = `);
Readln(a);
Write(`-Cho biet day dai = `);
Readln(b);
Write(`-Cho biet chieu cao = `);
Readln(h);
S := 0.5 * (a + b) * h;
Writeln(`+Dien tich hinh thang = `,s:6:2,` met vuong`);
Readln
End.
Bài 7
Program Tam_Giac;
Var
a,b,c:Integer;
p,s:Real;
Begin
Writeln(`CHUONG TRINH TINH DIEN TICH TAM GIAC`);
Write(`-Cho biet canh thu nhat = `);
Readln(a);
Write(`-Cho biet canh thu hai = `);
Readln(b);
Write(`-Cho biet canh thu ba = `);
Readln(c);
p := 0.5 * (a + b + c);
s := sqrt(p*(p-a)*(p-c)*(p-c));
Writeln(`+Dien tich hinh tam giac = `,s:6:2,` met vuong`);
* 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ẻ: Lê Huỳnh
Dung lượng: 340,22KB|
Lượt tài: 0
Loại file: zip
Nguồn : Chưa rõ
(Tài liệu chưa được thẩm định)