tailieunhanh - Giáo trình " Lý thuyết và bài tập Turbo pascal _ Chương 1"

Tài liệu tham khảo lý thuyết và bài tập phần ngôn ngữ lập trình Pascal. | 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 sol 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 sol 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 sol 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 Begin Writeln Nam