1. Trang chủ
  2. » Giáo án - Bài giảng

những bài tập pascal cơ bản và nâng cao

78 542 5

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 78
Dung lượng 534,5 KB

Nội dung

  B à i 1    !  " #$ %&'  %()  *  #  &+,  %-    ."  ( **#  )/0/12 03  *%2 4*5655  *32 3 7+( **2 8*%39:);)7)<04))01=>2 8*%39:??????????????????????????????????????????????????????????????:>2 8*%39@  3.  +A@>2  *3+9>2 8*%39@  3.  *A@>2*3+96>2 AB62 A9C6>B 2 8*%39@;3  %.%=5 >2 8*%39@.    .%@5 >2 D3+2 B à i 2  6E  F-  "&%*G()  *#&+,%-."( **#  )DH2 03*%2 4*  *5+%5*32 3 **2 8*%39@);)7)<  04))DH@>2 8*%39@??????????????????????????????????????????????????????@>2 8*%39@  6F  DA@>2*3+9*>2 +%AB*B*2 A BB*2 8*%39@;3  %    %*  @5+% >2 8*%39@.    %*  @5 >2 D3+2 7+( B à i 3  Tính tam giácIJ  6 K5656L%F& (MN#  %*O3#%N P$ +6 ! Q  FR5  S.  FR  %&   *  #  &  @ M  6   .  #% %# @(T ! 5%&+,%-5."%#E  *#  &( **#  1U)12 03*%2 4* 56555*32 3 **2 8*%39:1)H11U  )1=>2 8*%39@?????????????????????????????????@>2 8*%39@  A@>2*3+9>2 8*%3  9@6  A@>2*3+96>2 8*%39@  A@>2*3+9>2 )V  99C6>W>+996C>W>+99C>W6>  %3 3 7 3 XY*.9Z[\\]^[^_>   7+ A9 C6C >` 2 Aa *%9B 9? >B9 ? 6>B9 ? >>2 8*% 39@ .    %# @ 5 B ^ >  2 8*% 39@ ;3 %  %#   @5^ >2 *  XY*.9Z[\\]^[^_> 7+( 8*%395=5:5  65=5:5  5  :  F  6.  %#  @>2 D3+2 B à i 44S%Tb  %*&   Tb   %*&  69O  C  6AZ> **#  )1)/0H/D)/1/12 4*  565O*32 3 **2 8*%39@)1)0HD)111cC  AZ@>2 8*%39@????????????????????????????????????????????????????????????@>2 8*%39@  A@>2  *3+9>2 8*%3  9@  6A@>2*3+96>2 )V9AZ>  %3 )V96AZ>%3 8*%39@  .%*    3#@> 73 73 d*%39@  .  %*    3#@> 7+( 8*%39@.%*  3#  OA@5?6`^ >2 D3+2 B à i 54S%Tb  %*&6L%  Tb  %*&69O  C  6  e Z> **#  1/0H/D)/1)2 03*%2 4*56*32 3 **2 8*%39@)1)1  0H  D)1  11cCWAZ@>2 8*%39@??????????????????????????????????????????????????????????????????????@>2 8*%39@A@>2*3+9>2 8*%39@  6A@>2*3+96>2 )VfWZ  %3 )VWZ  %3  8*%39@%  .  %*  3#  OWA@5?6`^ > 738*%39@%.  %*  3#  OfA@5?6`^ > 73 )V6WAZ%38*%39@%.%*      3#@> 73  d*%39@%  .%*    3#@>2 7+(( D3+2 B à i   4S%Tb  %*&Tb  %*&  6 9O C6OC  AZ> (**#  )1)/0H/D)/1))2 03*%2 4*  5655+5O5O5O *32 3 8*%39@)1)0HD)1))@>2 8*%39@???????????????????????????????????????????@>2 8 *% 39@3  A@>2*3+9>2 8*%39@3    6A@>2*3+96>2 8*%39@3  A@>2*3+9>2 * )V  AZ  %3 )V  6AZ%3 )V  AZ  %3 8*%39@.%*    3#@> 73 73 8*%39@.%*    3#@> 73 3 8*%39@.%*  #%3#  OA@5?`6^ > +A6B6?^BB2 )V  +AZ%3 8*%39@.%*  3#  F3  OA@5?6`9 B>^ > 73 )V  +fZ%3 8*%39@.%*    3#@> 7+( 7+2 D3+2 73 3 7+2 OA9?6Ca*%9+>>`9 B>2 O A9?6?a*%9+>>`9 B>2 8*%39@.%*    3#  :>2 8*%39:  OA@5O^ 5@    O A@5O ^ >2 B à i 7&#  E%*gh  L%%*^K  5655  +  95655PT%i6  -#>( **#  )U/H/H/12 03*%2 4*  5655+5#O*32 3 7+( **2 8*%39@)UHH1DHHH1555;@>2 8*%39@???????????????????????????????????????????????????????????????@>2 8*%39@A@>2D3+9>2 8*%39@  6A@>2  D3+96>2 8*%39@ A@>2 D3+9>2 8*%39@  +A@>2  D3+9+>2 #OA2 )V  6W#O%3#OA62 )V  +W#O%3#OA+2 8*%39@    %@5#O^ >2 D3+2 Bài 8 :&#E%*g  j  L%%*^  K565  5+95655  PT%i6  -#>( **#  )U/H/H/12 03*%2 4*  5655+5#*32 3 **2 8*%39@)UHH1DHH  H15  55;@>2 * _ 7+( 8*%39@???????????????????????????????????????????????????????????????@>2 8*%39@A@>2D3+9>2 8*%39@  6A@>2  D3+96>2 8*%39@ A@>2 D3+9>2 8*%39@  +A@>2  D3+9+>2 #A2 )V  6f#%3#A62 )Vf#%3  #A2 )V  +f#%3#A+2 8*%39@  %  @5#^ >2 D3+2 B à i 9  ,Tb  %*&  %.QS  %-  O  +  6Q  =  #   O  +  +Q  =   **#  )1)/7/1)/12 03*%2 4*  5655+5#5*32 +O5+Q5++*32 3 **2 8*%39@ )1)  71)1@>2 8*%39@??????????????????????????????????@>2 8*%39@  A@>2*3+9>2 8*%39@  6A@>2*3+96>2 8*%39@  A@>2*3+9>2 8*%39@  #A@>2*3+9#>2 8*%39@  A@>2*3+9>2 ++AB+?6B2 +OA#B+?6B2 +QAB?B#2 )V  ++AZ%3 )V  9+OAZ>+9+QAZ>%3 8*%39@3  3#3#@> 73d*%39@3    3#@> 73 3 7+2 8*%39@3  3#  @>2 8*%39@OA@5+O`++^ 5@    QA@5+Q`++^ >2 7+( D3+2 Bài 10    %R  ,   P   OJQ(kQ.QN P S%*# &  K%  %*Y+Th+!6l6Y.56Y.m%56Y.  JQ( **#  ;H)/)H/0/)1n2 03*%2 4*  5.%5Q5  O  %2 3 **2 8*%39@;H)  1  )H  0)1n@>2 * ^ 7+( 8*%39@??????????????????????????????????????@>2 8*%39@    Q  @>2*3+9O>2 AO+  _ZZ2 OAO  #+_ZZ2 .%AO +  Z2 OAO  #+Z2 8*%39@M3%a.A@5  5@  @5.%5@.%@5O5  @Q@>2 D3+2 B à i 1 1      %J#  6E  F-  "#$% PT   %*G(. P   #$% PN #  19O5 Q>  6L%F&  FN#  %*O3#  %.$ PT   %*G  Q  FRo **#  M)7U/D1/;)7U/0H/;0H/DH2 03*%2 4*  OZ5QZ5O5Q5+5**32 3 8*%39@M)7UD1  ;)7U0H;0H  DH@>2 8*%39@????????????????????????????????????????????????????????@>2 8*%39@6  FDA@>2*3+9*>2 8*%39@  %+%#+.  %*A  @>2*3+9OZ5  QZ>2 8*%39@  %+  +3#  A@>2*3+9O5Q>2 +ApD9pD9O?OZ>CpD9Q?QZ>>2 )V  *A+  %3 8*%39@;3#  1#  %*3  +.%*@> 73 )V  +W*%3  8*%39@;3#  1  #    +.  %*@> 73  8*%39@;3#  1#  %*+.%*@>2 7+( D3+2 B à i 1 2-  O Q 9  4hO5  Q  K%q>( **#  c/0n01/n2 03*%2 4*  O5Q5r*32 3 8*%39:)c0n01  n=>2 8*%39@??????????????????????????????????@>2 8*%39@  OA@>2*3+9O>2 8*%39@  Q  A@>2*3+9Q>2 )V  OWAZ  %3 3 73 7+ rA3O9QB9O>>2 8*%39@Os  Q  A  @5r^ >2 7+( 8*%39@M%+.+O    #@>2 D3+2 B à i 1 3-t **#  )/ /)1)/01203*%2 4*  55%%33*2 * ] [...]... Writeln('C(',n,',',k,') = ',c(n,k):6:0); Readln; End Bài 29: Lập tam giác PASCAL, bằng Cn k(dùng chương trình con) n Program TAM_GIAC _PASCAL; Uses Crt; Var i,j,n,k:integer; Trang 12 Function gt(n:integer):longint; Var kq,i:integer; Begin kq:=1; For i:=1 to n do kq:=kq*i; gt:=kq; End; Function C(k,n:integer):real; Begin C:=gt(n)/(gt(k)*gt(n-k)); End; Begin Clrscr; Writeln('VIET TAM GIAC PASCAL: '); Writeln(' ... Writeln(td:6, tn:12, tg:15); Readln; End Trang 9 Bài 23: Tạo bảng số dạng sau: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 Program BANG_SO; Uses crt; Var i,j,n:integer; Begin Clrscr; Writeln(' TAO BANG SO TU 0-99'); Writeln(' -'); For i:=0 to 99 do Begin If (i mod 10 = 0) then Writeln; Write(i:3) End; Readln; End Bài 24: Tạo hình a) * ** *** **** ***** b) *****... readln(n); For i:=0 to n do Begin For j:=0 to i do Write(C(j,i):3:0); Writeln; End; Readln; End Bài 30: Viết các chương trình con tính diện tích tam giác, tròn, vuông, chữ nhật trong một chương trình Sau đó hỏi chọn một trong các phương án tính diện tích bằng cách chọn trong bảng chọn lệnh sau: 0 Không làm gì hết và trở về màn hình soạn thảo 1 Tính diện tích hình vuông 2 Tính diện tích hình tròn 3 Tính... Begin W riteln('Cac so nguyen to . D3+9>2 8*%39@  +A@>2  D3+9+>2 #OA2 )V  6W#O%3#OA62 )V  +W#O%3#OA+2 8*%39@    %@5#O^ >2 D3+2 Bài 8 :&#E%*g  j  L%%*^  K565  5+95655  PT%i6  -#>( **#  )U/H/H/12 03*%2 4*  5655+5#*32 3 **2 8*%39@)UHH1DHH  H15  55;@>2 * _ 7+( 8*%39@???????????????????????????????????????????????????????????????@>2 8*%39@A@>2D3+9>2 8*%39@  6A@>2  D3+96>2 8*%39@. )1)  71)1@>2 8*%39@??????????????????????????????????@>2 8*%39@  A@>2*3+9>2 8*%39@  6A@>2*3+96>2 8*%39@  A@>2*3+9>2 8*%39@  #A@>2*3+9#>2 8*%39@  A@>2*3+9>2 ++AB+?6B2 +OA#B+?6B2 +QAB?B#2 )V  ++AZ%3 )V  9+OAZ>+9+QAZ>%3 8*%39@3  3#3#@> 73d*%39@3    3#@> 73 3 7+2 8*%39@3  3#  @>2 8*%39@OA@5+O`++^ 5@    QA@5+Q`++^ >2 7+( D3+2 Bài 10    %R  ,   P   OJQ(kQ.QN P S%*# &  K%  %*Y+Th+!6l6Y.56Y.m%56Y.  JQ( **#  ;H)/)H/0/)1n2 03*%2 4*  5.%5Q5  O  %2 3 **2 8*%39@;H)  1  )H  0)1n@>2 * ^ 7+( 8*%39@??????????????????????????????????????@>2 8*%39@    Q  @>2*3+9O>2 AO+  _ZZ2 OAO  #+_ZZ2 .%AO. D)  )UH@>2 8*%39@??????????????????????????????????@>2 u*A  %   + u*wAZ  %   + u*FAZ%   + V9ZZBCZBwCF>A9BB  C  wBwBwC  FBFBF>%3 8*%395w5F5@  A  @55@s_C  @5w5@s_  C@5F5@s_@>2 7+( D3+2 Bài 19  #$%K  .QY  FR  J#5  FN# % *  O3#      K  .QY%K  QFRo **#  H/0n7/H2 03*%2 4*  5  %33*2 3 **2 8*%39@M)7UD1  H  0n7H@>2 8*%39@????????????????????????????????????????@>2 8*%39@F3#%*    A  @>2*3+9>2 )V  9AZ>*9A>%3 8*%395@  M      .Q3  %@> 73 3 7+2 A2 D33% A  C2 0%  9#+  AZ>*  9BW>2 )V  BW  %38*%395@  .Q3  %@> 73  8*%395@  F    .Q3  %@>2 7+( D3+2 B

Ngày đăng: 06/02/2015, 08:00

TỪ KHÓA LIÊN QUAN

w