Ly thuyet va bai tap pascal
Chia sẻ bởi Nguyễn Đặng Nhi |
Ngày 14/10/2018 |
26
Chia sẻ tài liệu: ly thuyet va bai tap pascal thuộc Tư liệu tham khảo
Nội dung tài liệu:
GIAO TRINH LY THUYET VA BAI TAP TURBO PASCAL-CHUONG 1
Dang Thanh Tuan(15/3/2004)
**********0101**********
Program PTB2;
Var
a,b,c:Integer;
delta,x1,x2:Real;
Begin
Writeln(`GIAI PHUONG TRINH BAC HAI`);
Writeln(` --------------`);
Repeat
Write(`-Nhap he so a= `);
Readln(a);
Until a <>0;
Write(`-Nhap he so b= `);
Readln(b);
Write(`-Nhap he so c= `);
Readln(c);
delta:=b*b-4*a*c;
If delta < 0 Then
Writeln(`*Phuong trinh vo nghiem`)
Else
If delta = 0 Then
Writeln(`*Phuong trinh co 2 nghiem bang nhau X= `,-b/2*a:6:2)
Else
Begin
x1:=(-b-sqrt(delta))/2*a;
x2:=(-b+sqrt(delta))/2*a;
Writeln(`*Nghiem thu nhat X1= `,x1:6:2);
Writeln(`*Nghiem thu hai X2= `,x2:6:2);
End;
readln
End.
**********0102**********
Program Ao_thu;
Begin
Writeln(` BAI THO AO THU`);
Writeln(`Ao thu lanh leo nuoc trong veo`);
Writeln(`Mot chiec thuyen cau be teo teo`);
Writeln(`Song biec theo lan hoi gon ty`);
Writeln(`La vang truoc gio se dua veo`);
Writeln(` NGUYEN KHUYEN`);
Readln
End.
**********0103**********
Program So_hoc;
Var
so1,so2,tong,hieu,tich:Integer;
thuong:Real;
Begin
Write(`-Nhap so thu nhat = `);
Readln(so1);
Write(`-Nhap so thu hai = `);
Readln(so2);
tong := so1 + so2;
hieu := so1 - so2;
tich := so1 * so2;
thuong := so1 / so2;
Writeln(`*Tong cua hai so `,so1,` va `,so2,` = `,tong);
Writeln(`*Hieu cua hai so `,so1,` va `,so2,` = `,hieu);
Writeln(`*Tich cua hai so `,so1,` va `,so2,` = `,tich);
Writeln(`*Thuong cua hai so `,so1,` va `,so2,` = `,thuong:6:2);
Readln
End.
**********0104**********
Program Pithagore;
Var
a,b :Integer;
c:Real;
Begin
Writeln(` CHUONG TRINH TINH CANH HUYEN TAM GIAC VUONG`);
Writeln(` theo dinh ly Pithagore`);
Write(`-Nhap canh a = `);
Readln(a);
Write(`-Nhap canh b = `);
Readln(b);
c := Sqrt((a*a) + (b*b));
Writeln(`*Canh huyen = `,c:6:2);
Readln
End.
**********0105**********
Program Phep_Cong;
Var
so1,so2,so3,tong :Integer;
Begin
Writeln(` CHUONG TRINH THUC HIEN PHEP CONG SO HOC`);
Writeln(` co toi da 4 ky so`);
Write(`-Nhap so thu nhat = `);
Readln(so1);
Write(`-Nhap so thu hai = `);
Readln(so2);
Write(`-Nhap so thu ba = `);
Readln(so3);
tong:= so1+so2+so3;
Writeln;
Writeln;
Writeln(`-------------------------------`);
Writeln;
Writeln(` `,so1:4);
Writeln(` + `,so2:4);
Writeln(` `,so3:4);
Writeln(` -----`);
Writeln(` = `,tong:5);
Readln
End.
**********0106**********
Program Lenh_Write;
Begin
Write(`Nam `);
Write(`Quoc `);
Write(`Son `);
Write(`Ha `);
Write(`Nam `);
Write(`De `);
Write(`Cu `);
Readln
End.
**********0107
Program Lenh_Writeln;
Dang Thanh Tuan(15/3/2004)
**********0101**********
Program PTB2;
Var
a,b,c:Integer;
delta,x1,x2:Real;
Begin
Writeln(`GIAI PHUONG TRINH BAC HAI`);
Writeln(` --------------`);
Repeat
Write(`-Nhap he so a= `);
Readln(a);
Until a <>0;
Write(`-Nhap he so b= `);
Readln(b);
Write(`-Nhap he so c= `);
Readln(c);
delta:=b*b-4*a*c;
If delta < 0 Then
Writeln(`*Phuong trinh vo nghiem`)
Else
If delta = 0 Then
Writeln(`*Phuong trinh co 2 nghiem bang nhau X= `,-b/2*a:6:2)
Else
Begin
x1:=(-b-sqrt(delta))/2*a;
x2:=(-b+sqrt(delta))/2*a;
Writeln(`*Nghiem thu nhat X1= `,x1:6:2);
Writeln(`*Nghiem thu hai X2= `,x2:6:2);
End;
readln
End.
**********0102**********
Program Ao_thu;
Begin
Writeln(` BAI THO AO THU`);
Writeln(`Ao thu lanh leo nuoc trong veo`);
Writeln(`Mot chiec thuyen cau be teo teo`);
Writeln(`Song biec theo lan hoi gon ty`);
Writeln(`La vang truoc gio se dua veo`);
Writeln(` NGUYEN KHUYEN`);
Readln
End.
**********0103**********
Program So_hoc;
Var
so1,so2,tong,hieu,tich:Integer;
thuong:Real;
Begin
Write(`-Nhap so thu nhat = `);
Readln(so1);
Write(`-Nhap so thu hai = `);
Readln(so2);
tong := so1 + so2;
hieu := so1 - so2;
tich := so1 * so2;
thuong := so1 / so2;
Writeln(`*Tong cua hai so `,so1,` va `,so2,` = `,tong);
Writeln(`*Hieu cua hai so `,so1,` va `,so2,` = `,hieu);
Writeln(`*Tich cua hai so `,so1,` va `,so2,` = `,tich);
Writeln(`*Thuong cua hai so `,so1,` va `,so2,` = `,thuong:6:2);
Readln
End.
**********0104**********
Program Pithagore;
Var
a,b :Integer;
c:Real;
Begin
Writeln(` CHUONG TRINH TINH CANH HUYEN TAM GIAC VUONG`);
Writeln(` theo dinh ly Pithagore`);
Write(`-Nhap canh a = `);
Readln(a);
Write(`-Nhap canh b = `);
Readln(b);
c := Sqrt((a*a) + (b*b));
Writeln(`*Canh huyen = `,c:6:2);
Readln
End.
**********0105**********
Program Phep_Cong;
Var
so1,so2,so3,tong :Integer;
Begin
Writeln(` CHUONG TRINH THUC HIEN PHEP CONG SO HOC`);
Writeln(` co toi da 4 ky so`);
Write(`-Nhap so thu nhat = `);
Readln(so1);
Write(`-Nhap so thu hai = `);
Readln(so2);
Write(`-Nhap so thu ba = `);
Readln(so3);
tong:= so1+so2+so3;
Writeln;
Writeln;
Writeln(`-------------------------------`);
Writeln;
Writeln(` `,so1:4);
Writeln(` + `,so2:4);
Writeln(` `,so3:4);
Writeln(` -----`);
Writeln(` = `,tong:5);
Readln
End.
**********0106**********
Program Lenh_Write;
Begin
Write(`Nam `);
Write(`Quoc `);
Write(`Son `);
Write(`Ha `);
Write(`Nam `);
Write(`De `);
Write(`Cu `);
Readln
End.
**********0107
Program Lenh_Writeln;
* 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 Đặng Nhi
Dung lượng: 4,45KB|
Lượt tài: 0
Loại file: rar
Nguồn : Chưa rõ
(Tài liệu chưa được thẩm định)