intTypePromotion=1
zunia.vn Tuyển sinh 2024 dành cho Gen-Z zunia.vn zunia.vn
ADSENSE

Giáo trình Pascal nâng cao

Chia sẻ: Nguyen Nhi | Ngày: | Loại File: PDF | Số trang:36

263
lượt xem
82
download
 
  Download Vui lòng tải xuống để xem tài liệu đầy đủ

Ngôn ngữ pascal đã cung cấp cho chúng ta các kiểu dữ liệu từ đơn giản đến nâng cao như tập tin, con trở, ... Bây giờ làm quen với một kiểu dữ liệu mới gọi là kiểu procedue

Chủ đề:
Lưu

Nội dung Text: Giáo trình Pascal nâng cao

  1. !"#$%&1 KI ÃØU D ÆÎ LI ÃÛU PROCEDURE !" #$%&!'(!)*+','-.($'(/$0%'#!)12'345678247 9" #$%&!'(!)*+ !"#$%$"&'%()*+),%-)'%+.$"%+/01%+23%+2.4$"%5)%+)4+%6789.%:&'% ,78;.%5&?AAA%B/C%"7=?BA I789.%(@3+F:.@F%,)
  2. Hoaìng Hæîu Haûnh 3EFAEG'(HIJ'AE@'K%CLEIABC'3EFAEGM !!" #$%!'N%&5'N!)O('345678247 I2)7%K)43%K780$%6789.%(@3+F:.@F%+.'$"%KQ$2%52&=%-80$%+)4+%(@3+F:.@F%+34%-#07%*#0%6789.%+2.#k7A • -()*+%,)% 5@3>% -80$%+)4+%(@3+F:.@F%+34% K#0$%-#07%*#0% G=47%K)%-#07%*#0% -/U. 6789.%./01?%-#07%*#0%52&4%5&%6789.%+2.#k7A • ,2%3+%,)% 5@3>% -80$%+)4+%a.$+573$%+34% K)%-#07%*#0% D)% 5@3>% G))% +)4+% K780$% 6789. (@3+F:.@F%12)>7%,)
  3. Hoaìng Hæîu Haûnh 3EFAEG'(HIJ'AE@'K%CLEIABC'3EFAEGM := ; I2#$"% $2&% 12F41% ")4$% -#07% G=47% +)4+% K780$% +34% 6789.% +=% K)>$?% 12F41% ")4$% =>% -/C% D)$"% C4 $"2[)%,)
  4. Hoaìng Hæîu Haûnh 3EFAEG'(HIJ'AE@'K%CLEIABC'3EFAEGM {-- Gaïn giaï trë vaìo biãún Procedure --} Case Ch Of ‘+’: FuncVar:=Cong; ‘-’: FuncVar:=Tru; ‘*’: FuncVar:=Nhan; ‘/’: FuncVar:=Chia; End; WriteLn(‘Kãút quaí laì: ’, FuncVar(x, y):2:2); ReadLn; END. !"#$%&"'("%(")%("23/4%&-5/"%*'%+#,0 V@3$"%+2&=$"%5@Q$2%5@8$?%+2.4$"%5)%-)'%-O$2%$"2[)%D#H5%6789.%(@3+F:.@F%,)
  5. Hoaìng Hæîu Haûnh 3EFAEG'(HIJ'AE@'K%CLEIABC'3EFAEGM WriteLn('DEF'); End; {$F-} Procedure TT(pv: Proc); Begin pv; End; Procedure TB(VAR pv: Proc); Begin pv:=DEF_Proc; End; BEGIN p:=ABC_Proc; TT(p); TB(p); p; END. ABC DEF D" 3$7&3']5']%&($ S)4+%12F41%53)4$%*3%*)4$2%62#$"%)41%:.;$"%+23%+)4+%K780$%6789.%(@3+F:.@F?%:3%-34%+2.4$" 5)%62#$"%5289% *3%*)4$2%+)4+%K780$%6789.%(@3+F:.@F%-&=H+%D)%K780$%(@3+F:.@F%62#$"%5@3>%G)
  6. Hoaìng Hæîu Haûnh 3EFAEG'(HIJ'AE@'K%CLEIABC'3EFAEGM !'-Z[;'FZ['A>\E'6Y6'A@Q':;'3?@ABC>?B 9" S2.4$"%5)%+/U$%12/$%K78;5%"7&')%,=
  7. Hoaìng Hæîu Haûnh 3EFAEG'(HIJ'AE@'K%CLEIABC'3EFAEGM !"#$%&2 CHUY ÃØN ÂÄØI KI ÃØU – UNIT NG ÆÅÌI DUÌNG !d" 6$2e)1('-f1!'#!)12'KYe37'6%]Y!(/M VC1F%S)*57$"%,)7%*&>%:.;$"%$278U.%,8;$2%D=47%-);5%-&=H+%D.;+%-W+2A%n/0C%D#H5 GW% :.;% $2&% *).?% -0% ,))%+)4+%6C4%5&;%5@3$"%+2.#k7%52Q%12)>7%:.
  8. Hoaìng Hæîu Haûnh 3EFAEG'(HIJ'AE@'K%CLEIABC'3EFAEGM 05 85 117 114 98 111 !80.%5)%TFD%G.$%KLd$"%52.>%5.;+ N>3$*OPQHR#/GR#QHR#/HS%53H)%-#H%-Y$2%5@)47%5@8$%G)7%:&=47%12)>7%-&=H+%,&.%"7&'%5@3$" 2)7%K780$%6789.%N*)$%,)3$I>3 Cj Tj Pháön 4, Âäö hoaû trong Pascal !!)
  9. Hoaìng Hæîu Haûnh 3EFAEG'(HIJ'AE@'K%CLEIABC'3EFAEGM N>3$I5Q V3H)%-#H%-Y$2%12)>7%:&=47 !"#$%&'( !"#$%#)*+, Z89% ,/0C% +)4+% "7)4% 5@O% QG?% /G?% QH?% /H% 5&3$I>3% G)3$I5Q?% +2.4$"% 5) +.'$"%+34%5289%:.3%G)3$I5Q%G)
  10. Hoaìng Hæîu Haûnh 3EFAEG'(HIJ'AE@'K%CLEIABC'3EFAEGM until Result = 0; End; V2.>%5.;+%$)%:.;$"%6C'%52./;5%VC1F%S)*57$"%G=47%52)D%K780$%=%-89%*)3%+23%$34%,)%5.;+%415$U30%TFD%5280%$)
  11. Hoaìng Hæîu Haûnh 3EFAEG'(HIJ'AE@'K%CLEIABC'3EFAEGM S)4+%12/U$%-&=H+%*Lc1%T801%$2&%*).%5@3$"%D#H5%X7,F%$".#U$o {!"#$%#&'$()*+&$,-.'$/&01#/$234&$'"#$5&67 } UNIT ; USES ; {$F+} INTERFACE !"#! 8)*&$9*4:$'"#$;*4;$')
  12. Hoaìng Hæîu Haûnh 3EFAEG'(HIJ'AE@'K%CLEIABC'3EFAEGM PROCEDURE ThiDu1 (Var x, y: Real); PROCEDURE ThiDu2 (S: String); • 3PHsI'6Eu;'v!wb _.wA'APzQE'2(!Y ()*+),% 52#$"% 52&=7 !q_A%Z89%,)0#,>)1+0*)>1X%-&)%G)
  13. Hoaìng Hæîu Haûnh 3EFAEG'(HIJ'AE@'K%CLEIABC'3EFAEGM PROCEDURE ThiDu1 (Var x, y: Real); PROCEDURE ThiDu2 (S: String); FUNCTION TenF (i, j: integer):string; {$F-} IMPLEMENTATION {Pháön Caìi âàût } {;*4;$9&"1#$;)O$B7%62#$"%+34A S)4+%62)7%K)43%58$%5&XFA • B78$%:O+2o%B/0D%5#9%2=H1%12WD%A60#Y#2[%23L;+%2[A Pháön 4, Âäö hoaû trong Pascal !!"$
  14. Hoaìng Hæîu Haûnh 3EFAEG'(HIJ'AE@'K%CLEIABC'3EFAEGM V/;1%57$%K78$%:O+2%-&=H+%*F'%+34%12/U$%D=>%@#H$"%,)% :.;$"%+)4+%.$75% 62)4+% KLd$"% +)4+2% -&)% G)%:.;$"%.$75%62)4+o 7A Z&)%*).%5&I;b V@3$"%E.)4% 5@Q$2%T/C%:&;$"%+)4+%.$75%52Q%+34% 5289% T)>C%@)%5@&=
  15. Hoaìng Hæîu Haûnh 3EFAEG'(HIJ'AE@'K%CLEIABC'3EFAEGM +2&4)%52.>%5.;+%76)-+)A%S2.4$"%5)%G/k$%+34%5289%*&>%:.;$"%2)7%578;$%W+2%$))%2)7%.$75%$)%5.;+%$))%+)4+%,3);7%K780$%+3$%5@3>A ‚ƒ% +280% -#H% \^fn%6W+2%52&=4+%+.>)%D#H5%*F"DF$5%,)
  16. Hoaìng Hæîu Haûnh 3EFAEG'(HIJ'AE@'K%CLEIABC'3EFAEGM V2&;+%@)%+3%,C4%:);$"%!^f\%JI27%-&=H+ "3H7%+)4+%5@Q$2%T&>%,C4%:);$"%!F)@%*F'%-/9C%G)%,C4%:);$"%!F)@%5&
  17. Hoaìng Hæîu Haûnh 3EFAEG'(HIJ'AE@'K%CLEIABC'3EFAEGM TPUMOVER ↵ 7%8#9:589' TPUMOVER TURBO.TPL ↵ !"#$%&'# *F'%+23%6805%E.)>o Unit Code Data Uses System 22755 702 Overlay 1859 26 System Crt 1567 20 System Dos 1591 6 System Printer 54 256 System • YP7%V`\B]AV(n%G)
  18. Hoaìng Hæîu Haûnh 3EFAEG'(HIJ'AE@'K%CLEIABC'3EFAEGM !"#$%&3 TRUY XU ÁÚT VUÌNG NH ÅÏ MAÏY T ÊNH d!" N!)O('Y42e'‡2pOY'd2j(/'($k& 9D" N!)O('-.%'6$ˆ'Y2e)*Y'-fO! S)4+%K780$%-&=H+%62)7%K)43%5@3$"%+2&=$"%5@Q$2%*).%5&% 5.;+% =1O% 2)C% b10I1Z%-8U.% :3% D)4C% 5W$2% +2.>% -#H$"% *Lc1% T801% GO% 5@W +.>)%+2.4$"%5@3$"%K#H%$2=4A B780$%-O)%+2Y%5.C8;5%-#07%,)
  19. Hoaìng Hæîu Haûnh 3EFAEG'(HIJ'AE@'K%CLEIABC'3EFAEGM VAR Mode: Byte ABSOLUTE $0:$0449; Begin case Mode of 0: WriteLn(‘Mode 40x25 B/W’); 1: WriteLn(‘Mode 40x25 Color’); 2: WriteLn(‘Mode 80x25 B/W’); 3: WriteLn(‘Mode 80x25 Color’); 7: WriteLn(‘Mode 80x25 Hercule Mono’); end; ReadLn; End. 9g" N!)O('Y42e'‡2pOY'd2j(/'($k& V.@K3%()*+),%+.$"%+/01%+)4+%K780$%5@.C%T./05%G.
  20. Hoaìng Hæîu Haûnh 3EFAEG'(HIJ'AE@'K%CLEIABC'3EFAEGM Begin while St[Len] = #32 do Dec(Len); Trim := St; End; >2#%?$0 • (2)>7%K7805%@3'%-O)%+2Y?%-#H%,=4$%G))%*&'%,78;.%5@3$"%G.)%D#7%5@&=
ADSENSE

CÓ THỂ BẠN MUỐN DOWNLOAD

 

Đồng bộ tài khoản
2=>2