Bài Tập Pascal
Chia sẻ bởi Nguyễn Văn Bình |
Ngày 26/04/2019 |
137
Chia sẻ tài liệu: Bài Tập Pascal thuộc Công nghệ thông tin
Nội dung tài liệu:
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.
Program Tam_giac;
Begin
Writeln(`*********`);
Writeln(` *******`);
Writeln(` *****`);
Writeln(` ***`);
Writeln(` *`);
Readln
End.
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.
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.
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.
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.
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`);
Readln
End.
Program Hinh_cau;
Var
s:integer;
r,v:Real;
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.
Program Tam_giac;
Begin
Writeln(`*********`);
Writeln(` *******`);
Writeln(` *****`);
Writeln(` ***`);
Writeln(` *`);
Readln
End.
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.
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.
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.
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.
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`);
Readln
End.
Program Hinh_cau;
Var
s:integer;
r,v:Real;
* 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 Văn Bình
Dung lượng: |
Lượt tài: 0
Loại file:
Nguồn : Chưa rõ
(Tài liệu chưa được thẩm định)