Tải bản đầy đủ (.doc) (78 trang)

61 bài tập cơ bản cho người mới học Pascal

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (297.21 KB, 78 trang )

 
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
*
]
3
7+(
**2
8*%39@

)

)1)01@>2
8*%39@??????????????????????????????????@>2
8*%39@A@>2*3+9>2
%A2
u*A


%



+
%A%B2
8*%395

@tA
@5%>2
D3+2
B à i 1 4 

-O

94h

K

.QYFR

J#>(
**#

)/c/0n/01/2
03*%2
4*

55O%33*2
%*32

3
7+(
8*%39@

)c0n01

n@>2
8*%39@??????????????????????????????????@>2
8*%39@

OA@>2

*3+9O>2
8*%39@A@>2*3+9>2
%A2
u*A

%



+
%A%BO2
8*%39O5

@s@55@

A

@5%^ >2

D3+2

B à i 1 5 

-%

A




AZt
**#

)/H2
03*%2
4*55%%33*2
*32
3
**2
8*%39@0HD))

H@>2
8*%39@????????????????????????????????????????@>2
8*%39@

A@>2

D3+9>2
%A2

A2
u*A

%



+
3
7+2
%A%B2
AC`%2
7+(
8*%39@

A

@5[ >2
D3+2
*


B à i 1 6 

-%

A




O


A
**#

)/H 2
03*%2
4*5%33*2
O55%*32
3
**2
8*%39@)H0n01@>2
8*%39@??????????????????????????????????@>2
8*%39@

OA@>2*3+9O>2
8*%39@

A@>2*3+9>2
AZ2
%A2
u*A

%



+
3

7+2
%A%BO

2
AC%

2
7+(
8*%39@

A

@5[ >2
D3+2
n i
B à i 1 7 

-%

A



x


i=

Z


it
**#

)/H_2
03*%2
4*

55%%33*2
O55%*32
3
**2
8*%39@)H0n01`)1)01@>2
8*%39@??????????????????????????????????????????????????@>2
8*%39@

OA@>2*3+9O>2
8*%39@

A@>2*3+9>2
A 2
%A2
%A2
u*A

%



+
3

7+2
%A%BO

2
%A%B2
AC%`%

2
7+(
8*%39@

A

@5[ >2
D3+2
B à i

1 8 &#

%L%

E

'

K



6


'

K

6



%

E

Tb

"

E

'
K

%&

6l

-KP9

6


A
_
C6
_
C

_
>(**#)U/H2
03*%2
*
v
4*

5w5F%33*2
3
8*%39@0H 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 à i

2 0 )*EK

.QY%Kjbx

6l9K.QY

FR

J#
PT

%i6-#>(
**#

1/H/0n7/H2
03*%2
4*

55%


%33*2
3
**2
8*%39@) D1

1H0n7HfA@>2
8*%39@?????????????????????????????????????????????@>2
8*%39@

A@>2*3+9>2
)V

f %3
8*%39@M





.Q3

%

fA@5>
73
3
8
*%39@.Q3

%fA@55@@>2

u*A

%

+
3
%A2
*
[
7+2
D3+2
7+(
7+2
D33%
%A

%C2
0%9



#+

%

AZ>

*9%B%W>

2

)V9%B%W>%3
8*%39^>2
Bài

21 

_!%yK%yz
P
(kQ%&#

%L%



E

%


PT


"

_!
%y

%*Y

K


%y

i(
**#

;H)/)72
03*%2
4* O5Q5r555w55%2
3
**2
8*%39@0HD);H)

)7@>2
8*%39@???????????????????????????????????????@>2
8*%39@



%3

+

A

@>2*3+9>2
8*%39@




%3

%.

@>2*3+9O>2
8*%39@



%3

%. 

@>2*3+9Q>2
8*%39@



%3

%._

@>2*3+9r>2
8*%39@

@5O5@ @5Q5@ @5r>2
u*AZ

%


9

+O>+
u*wAZ

%

9

+

Q>+
u*

A

Z

%

9

+r>

+
)V9BOCwBQCBrA>

%3
8*%3


9[5w 5Z>2
7+(
D3+2
B à i 2 2 
*{#

%*J.

%*{#

j
*J.
P|


{{#
*J.

l#

{

6
*J.

6#$%6(
j




6

Y.

#}!o
**#

D1UD10/D1UH2
03*%2
4*

%+5%5%%33*2
3
**2
8*%39@D1UD10D1U

H@>2
8*%39@??????????????????????????????????@>2
8*%39@*.

+. *.

#*.@>2
u*%+AZ% Z+
u*%AZ%__+
u*

%AZ%

ZZ+

)V99]B%+C_B%C%`_AZZ>+

9%+C%C%AZZ>>%3
8*%39%+5

% 5

%]>2
D3+2
7+(
*
\
B à i 2 3 

!

6

K+!.
Z  _ ^ ]  v [ \
Z _^ ]

v [\
(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
**#

1/H2
03*%2
4*5w5%33*2
3

**2
8*%39@1H1H

0Z?\\@>2
8*%39@?????????????????????????????????????????????@>2
u*AZ

%

\\+
3
7+(
7+2
D3+2
)V9

#+Z

AZ>%3
8*%32
8*%39_>
B à i 2 4 

!&
>
B
6> >
BB

B


B

B B
B

B
B

B

B
B

BBB
BB

B

B

B
**#

1H/)/12
03*%2
4*

5w5


%33*2
3
B

BBB
B

B

B
B

B
B
B

BB
BB

BB

B
B

BBB

BB

B
B


B

B

B

B

B

B

B

B
**2
8*%39@1H)1@>2
8*%39@????????????????????????@>2
8*%39@

+

A@>2*3+9>2
u*A

%+
3
7+2
u*wA


%



+
8*%39@B

@>2
8*%32
7+(
D3+2
**#

1H/)/2
03*%2
4*

5w55#

%33*2
*

Z
3
**2
8*%39@ 1H)@>2
8*%39@????????????????????????????@>2
8*%39@+A


@>2*3+9>2
u*A

+d%+
3
D3+2
7+(
7+2
u*wA

%



+
8*%39@B

@>2
8*%32
**#

1H/)/2
03*%2
4*

5w55#

%33*2
3
**2

8*%39@ 1H)@>2
8*%39@????????????????????????????@>2
8*%39@+A

@>2*3+9>2
u*A



%+
3
D3+2
7+(
7+2
%OQ9?C]5C]>2
u*wA

%

B?

+
8*%39@B@>2
8*%32
B à i 2 6 

-

9+~


Tb%*&

>
**#

0n/012
03*%2
4*5%33*2
u.%

%95%33*>%2
4*

%33*2

Fa%2
3
FaA2
u*A

%



+
FaAFaB2
3
7+2
**2
%AFa2

8*%39@0HD))1s@>2
8*%39@??????????????????????????????????????????@>2
8*%39@

A@>2*3+9>2
8
*

%39@

A@>2*3+9>2
8*%395@s@55@

A

@5%95>>2
D3+2
*


7+(
B à i 2 7 

-

t9+~Tb

%*&>
**#


)1)/012
03*%2
4*%33*2
u.%

%9%33*>%2
4*

Fa5%33*2
3
3
7+2
**2
FaA2
u*A

%



+
FaAFaB2
%AFa2
7+(
8*%39@0HD))t@>2
8*%39@???????????????????????????????????????@>2
8*%39@

A@>2*3+9>2
8*%395@t


A

@5%9>>2
D3+2
B à i 2 8 

-

F


9+~

Tb%*&

>**#

H/H2
03*%2
4*

5F%33*2
u.%

%9%33*>%2
4*

Fa5%33*2
3

7+2
FaA2
u*A

%



+
FaAFaB2
%AFa2
u.%

95F%33*>*32
3
3
7+2
**2
A%9>`9%9F>B%9?F>>2
7+(
8*%39@0HD))1M

@>2
8*%39@??????????????????????????????????????????????@>2
8*%39@

A@>2*3+9>2
8*%39@

F


A

@>2*3+9F>2
8*%39@9@55@5@5F5@>

A

@595F>Z>2
D3+2
B à i 2 9 

%#E

1156l

F
9+~

Tb%*&

>


**#

1U/)1/112 03*%2
4*

5w55F%33*2

*


u.%

%9%33*>%2
4*

Fa5%33*2
3
7+2
FaA2
u*A

%



+
FaAFaB2
%AFa2
u.%

9F5%33*>*32
3
3
7+2
**2
A%9>`9%9F>B%9?F>>2
8*%39@4)7


1U)1

11@>2
8*%39@?????????????????????????????????@>2
8*%39@

A@>2*3+9>2
u*AZ

%



+
3
7+(
7+2
D3+2
u*wAZ

%



+
8*%399w5>_Z>2
8*%32
B à i


3 0 

4S%E

Tb%*&%-+,

%-

%#E5

%*G5.R5

'%%*
#$%Tb%*&( .
P
jX

#$%%*ETbE

%-+,

%-

6l

E
X

%*


6

X,

.
Z(

MR#&

S%%*•y

#

&!%(
(

-

+,

%-&

.R
(

-

+,

%-&%*G

_(

-

+,

%-

%#

E
^(

-

+,

%-&
ӳ



%
**#

)/;)7/)2
03*%2
*3+.*3

42

4*

5*32
3
7+2
8*%39@) ;)7 ) ) 40H@>2
8*%39@3.+.



A

@>2*3+9>2
AB2
8*%39@;3

%



.A

@5 >2
*3+.*3

2
4*5**32
3
7+2

×