Các bài tập Pascal lớp 11 - pdf 17

Download miễn phí Các bài tập Pascal lớp 11



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.
 



Để tải bản Đầy Đủ của tài liệu, xin Trả lời bài viết này, Mods sẽ gửi Link download cho bạn sớm nhất qua hòm tin nhắn.
Ai cần download tài liệu gì mà không tìm thấy ở đây, thì đăng yêu cầu down tại đây nhé:
Nhận download tài liệu miễn phí

Tóm tắt nội dung tài liệu:

BÀI TẬP PASCAL
Chủ nhật, 30/11/2008 12:23 pm
BÀI TẬP PASCAL
Chương 1.
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
rogram 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');
            Readln
End.
Bài 8
Program Hinh_cau;
Var
            s:integer;
   r,v:Real;
Begin
            Writeln('CHUONG TRINH TINH THE TICH HINH CAU');
   Writeln('---------------------------------');
   Write('Cho biet dien tich hinh tron = ');
   Readln(s);
   r:=Sqrt(s/4*3.1416);
   v:=4/3 * 3.1416 *r*r*r;
   Writeln('*The tich hinh cau la : ',V:6:2,' met khoi');
   Readln
End.
Bài 9
Program Luc_hut;
CONST
            g=6.672E-8;
Var
            m1,m2,d,f:Real;
Begin
            Writeln('CHUONG TRINH TINH LUC HUT GIUA 2 VAT');
   Write('-Khoi luong m1 (gam) = ');
   Readln(m1);
   Write('-Khoi luong m2 (gam) = ');
   Readln(m2);
   Write('-Khoang cac giua 2 vat (Cm) = ');
   Readln(d);
   f := g * m1 * m2 / sqr(d);
   Writeln('+Luc hut giua 2 vat = ',f:6:2);
   Readln
End.
Bài 10
Program Pignet;
Var
            Ten:String;
   Tuoi:Integer;
   lon,nho,tb,tl,cao,pig:Real;
Begin
            Writeln('CHUONG TRINH TINH PIGNET');
   Writeln('------------------------');
   Write('-Cho biet ho ten : ');
   Readln(ten);
   Write('-Cho biet tuoi   : ');
   Readln(tuoi);
   Write('-Cho biet chieu cao : ');
   Readln(cao);
   Write('-Cho biet trong luong : ');
   Readln(tl);
   Write('-So do vong nguc luc hit vao = ');
   Readln(lon);
   Write('-So do vong nguc luc tho ra = ');
   Readln(nho);
   tb := 0.5 * (lon-nho);
   pig := cao - (tb + tl);
   Writeln;
   Write('+Ong (Ba) : ',ten:24);
   Writeln(' , ',tuoi,' tuoi');
   Writeln('+Co so do Pignet = ',pig:6:2);
   Readln
End.
Bài 11
Program Tinh_luong;
Var
            Ten:String;
   nc,pc,tam:Integer;
   bl,hs,tt,cl:Real;
Begin
            Writeln('CHUONG TRINH TINH LUONG');
   Writeln('------------------------');
   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 trach nhiem : ');
   Readln(hs);
   Write('-Cho biet phu cap khu vuc = ');
   Readln(pc);
   Write('-Cho biet so tien da tam ung ky 1 = ');
   Readln(tam);
   tt := ((bl/30 * nc * hs)+pc);
   cl := tt - tam;
   Writeln;
   Writeln('+Ong (Ba) : ',ten:24);
   Writeln('+Tien luong trong thang = ',tt:10:2,' dong');
   Writeln('+So tien con linh = ',cl:10:2,' dong');
   Writeln('   Bam phim de ket thuc');
   Readln
End.
Bài 12
Program Tinh_dien_tich;
Var
   cv,canh,s:Real;
Begin
            Writeln('TINH DIEN TICH LON NHAT CUA HINH CHU NHAT');
   Writeln('-----------------------------------------');
   Write('-Cho biet chu vi chu nhat : ');
   Readln(cv);
   canh:=cv / 4;
   s:=canh * canh;
   Writeln('-Chu vi hinh chu nhat = ',cv:10:2,' met');
   Writeln('-Dien tich lon nhat se= ',s:10:2,' met vuong' );
   Writeln('   Bam phim de ket thuc');
   Readln
End.
Bài 13
Program Tam_thuc;
Var
            a,b,c,x,p:Integer;
Begin
            Writeln('TINH TAM THUC');
            Writeln('-------------');
            Write('-Nhap a= ');
            Readln(a);
   Write('-Nhap b= ');
            Readln(b);
   Write('-Nhap c= ');
            Readln(c);
   Write('-Nhap x= ');
            Readln(x);
   p:=((a*(x*x)) + (b*x) + c);
   Writeln('*Tri cua tam thuc = ',p);
   Writeln('Bam phim de ket thuc');
            Readln
End.
Bài 14
Program Tinh_do_dai_vec_to;
Var
       x,y,z:Integer;
                    l:Real;
Begin
            Writeln('TINH CHIEU DAI VECTO');
   Writeln('---------------------');
   Writeln;
   Write('-Cho biet toa do X : ');
   Readln(x);
   Write('-Cho biet toa do Y : ');
   Readln(y);
   Write('-Cho biet toa do Z : ');
   Readln(z);
   l:= Sqrt(Sqr(x) + Sqr(y) + Sqr(z));
   Writeln('+Chieu dai cua vecto = ',l:10:2);
   Writeln('    Bam phim de ket thuc');
   Readln
End.
Bài 15
Program Tinh_Z;
Var
            x,z:Real;
Begin
            Writeln('TINH GIA TRI Z QUA SO THUC X');
   Writeln('----------------------------');
   Write('-Nhap tri x = ');
   Readln(x);
   z:=ln(x + abs(sin(2 * x)));
   Writeln('*Gia tri cua Z = ',z:10:2);
   Writeln(' Bam phim de ket thuc');
   Readln
End.
Chương 2.
Bài 1
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.
Bài 2
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 : '...
Music ♫

Copyright: Tài liệu đại học © DMCA.com Protection Status