3 ?
T |?
!y?
3 ?
T |?
!y?
3 ?
T
3 ?
T
C?y# 
?y# 
?
"d 7?
?
"d 7?
?
?
2?
?
f
f
? C?y
^YVf
?
LC
 v??
!9¥b
[??y
^YVf
?
LC
 v??
!9¥b
[?
v¥ C?y?¨??aa
^??f
F?¥
?f
?y?¨??aa
^??f
F?¥
?f
sY?ò1¥?
 vb
sY?ò1¥?
 vb
? 2.1f
¥?lD?¨
? 2.2f
¥ 3*?¨D?B?¨
? 2.3
FT1f
?
? 2.4
=?M
D??M

=?M
D??M

? 2.5
=?f
D??f
=?f
D??f
? 2.6 M
¥?
i%Dá
i%
2.1f
¥?lD?¨
? f
¥?lf
¥?l
? f
¥Rí′Df
??f
¥Rí′Df
??
? $?¨f
¥
a
üf
e?$?¨f
¥
a
üf
e?
? f
¥?¨f
¥?¨
? f
¥??D
L?f
¥??D
L?
2.1,1f
¥?l
? 1 ?f

 ??f
main() ?
^?f
a
üf
8
?sF?b? f
^?31
a
üf
8
?sF?b? f
^?31
?
 V|f
s1í?f
μ?f
?b
?
 V|f
s1í?f
μ?f
?b
? 

1í?f
¥B??
Tí?f
¥B??
T
?f
??f
??f
f
( void )
? {
a
ü? ?s
a
ü? ?s
? V3?? ?s V3?? ?s
? }

2μ?f
¥B??
T
f
??f
(
?? ?
[
?? ?
2……] )
{
a
ü? ?s
V3?? ?s
}
μ?f
1í?f

B??
Vb?¨μ?f
H?
¨f
|?í?t?
L=¥′b
1
D?¨f
4¥
L=?
uY 7|f
?l?¥?
V?1?
T?
Ve???Vb
[? è
? è
2.1] ?lB?f
¨? p
?
?¥v
b
?lB?f
¨? p
?
?¥v
b
/*?
?lB? p?v
¥f
i?f
??¨
?
?lB? p?v
¥f
i?f
??¨
*/
int max(int n1,int n2)
{ return (n1>n2?n1:n2)

}
main()
{ int max(int n1,int n2)

/*f
a
ü
f
a
ü
*/
int num1,num2

printf("input two numbers:\n")

scanf("%d%d",&num1,&num2)

printf("max=%d\n",max(num1,num2))

getch();
} ???
???


1

2
a
ü

1f
?l?
? 3* b
(?y?
μf

 ??f
main()?
^
ü
? ¥ bB ?f
¥ ? l V[b???¥ ?iê?
?f
main()- --ab?B?f
¥f
8
=
?
?l
6B?f
'?
3*?lb

2 bf
aa;í?
af
8?1 b¥f
b
B??
T1
[f
?? ]f
(void)
{ }

3 o?' C?y??
??
a
ü
?bf
a
ü?s¥? 2???·?b
2.1.2f
¥Rí′Df
??
f
¥Rí′Df
??
(?y¥f
Yμ 
?y?¥f
V ?
??
?
??
 V? ??  A ? Vüf
s1μRí′f

 ?? ? Vüf
s1μRí′f

Rí′f
?b
1f
Rí′D
f
Rí′D
return? 
μ?f
¥Rí′
^YVf
?¥
μ?f
¥Rí′
^YVf
?¥
return?
?
 ?¤¥b


1

return? ¥B?ì
T
? ¥B?ì
T
return ( Rí
′Vr
T
′Vr
T
);


2

return? ¥?
Rí?¨f
i
|
|
“Rí′Vr
T
Rí′Vr
T
”¥′{ó?¨f
b
2f
??
?lf
Hf
??¥
a
ü?D return
? ?aRí′Vr
T¥ ??Báb
?T ?B á 5[f
??1b ?T ?
8f
??5"dB
p???) ?b
z¥??
!98 1

P?? μ
z¥ V
?ih
 pO?1 pRí′¥f
???l1
b ?? '
Pf
??1??9?
P¨"d¥ ?
8
) ?b
2.1.3 $?¨f
¥
a
üf
e?
$?¨f
¥
a
üf
e?


ANSI C?S??¨f
e?Z
T$?¨
?S??¨f
e?Z
T$?¨
f
é?
a
ü B?ì
T ?/
f
é?
a
ü B?ì
T ?/
f
??
f
??
f

f

(
??
??
[ ?

?

][,
??
??
[ …])

(?y]
H??[/
(?y]
H??[/
2? f ?/ V[
8 ?
? f ?/ V[
8 ?
$?¨f
¥
a
ü
$?¨f
¥
a
ü


1?$?¨f
¥f
?lC? ¨f
- -
¨f
- -
Hb y1?¨- -Ir"dXü??
$?¨f
¥
y1?¨- -Ir"dXü??
$?¨f
¥
f
??a?
?
a ??
¨?b


2 ?T
μf
?l- -f
??
è ?
 ?T
μf
?l- -f
??
è ?
óq 7
S)?5ò?f
é?

a
ü5?¨f
óq 7
S)?5ò?f
é?

a
ü5?¨f
? V ?
8$?¨f
¥
a
üb
? V ?
8$?¨f
¥
a
üb
2.1.4f
¥?¨
 ? ? ? 
^ YV f
¥ ? ¨ ? 3 ?f
8¥ 
 ? ? ? 
^ Y
¨ ? 3 ?
8¥ 
V?D 
?y¥0???¨M
b
V?D 
?y¥0???¨M
b
(?y?f
?¨¥B??
T1
(?y?f
?¨¥B??
T1
f

f

([
L=?
L=?
V
V
])
M:
M:

L?¥?
a ??
¨???D$?¨f

L?¥?
a ??
¨???D$?¨f
1 p¥ ?
?
a ? ?
¨?Bá?
? ?1é?
1 ?
?
?
¨?Bá?
? ?1é?
.?b
(?y? V[¨[/+?Z
T?¨f

(?y? V[¨[/+?Z
T?¨f



1

f
Vr
T
f
Vr
T
b


2f
? 
f
? 
b


3

f
L?
f
L?
b
a
ü 

1?¨f
Hf
?A?D μ??
¥1
?lf
?? ?Báb

2
L? ??
?
¨?D??A?BB?
¥b ?T ???
¥ CIr??|??′Y ?¥5
é?Db ?T
L??? ¥ ? ?? ?′ Y ? Y èi
?óp? O?? ˉ ?? ?3 ? o
^ ¤? ??
?¥2Tb

3 ?T
L?V? ???

L?¥ p′
¨
?
"d7sbμ¥"d?1P_·
¨? p
L?¥′
μ¥"d5MQb Turbo C MS C
^?1·_P¥
¨?é
?¥ b
2.1.5f
¥??D
L?
f
¥??D
L?
f
¥?
s1
f
¥?
s1
??
??

L?
L?
?T¨
^
L
?T¨
^
L
C
.
b
??Cf
?l?o
?f
8
=
??Cf
?l?o
?f
8
=
P¨b?
3f
?¨
H?¨f

L?¥′ˉ
P¨b?
3f
?¨
H?¨f

L?¥′ˉ
?
?
1z.
ó$?¨f
¥??V7
LC?
z.
ó$?¨f
¥??V7
LC?
¨f
_$?¨f
¥
.
b
¨f
_$?¨f
¥
.
b
[? è
? è
2.3]
L???¥
.?b
/*
L???¥
.?b */
void main()
{ void s(int n); /*
a
üf
a
üf
*/
int n=100; /*?l
L?
?l
L?
n

i
S */
s(n); /*?¨f
*/
printf("n_s=%d\n",n);
getch();
}
void s(int n)
{ int i;
printf("n_x=%d\n",n); /*
{?M -??¥′
{?M -??¥′
*/
for(i=n-1; i>=1; i--) n=n+i; /*?M??¥′
?M??¥′
*/
printf("n_x=%d\n",n); /*
{?Ma??¥′
{?Ma??¥′
*/
} ???
???


2

a
ü
a
ü


1
L? V[
^è
aM
aVr
Taf
?bí
L ?
^? ?? ¥
 é?f
?¨
H
ì?A
L ?
^ ?? é?f
?¨
H
ì?A
? μ ??¥′[Lü?t′.
ó??b
? μ ??¥′[Lü?t′.
ó??b
y N ??5¨?′a
{ ??÷E
P
L?¤ ?
y ??5¨?′a
{ ??÷E
P
L?¤ ?
?¥′b


2??M
oμ$?¨
H? s

=i ?í 
??M
oμ$?¨
H? s
¥ 
?¨2
H' Y
db
s
¥¥
=i?íb
?¨2
H' Y
db
s
¥¥
=i?íb


3
L???¥
.
^?_ ¥ 'o

L

L???¥
.
^?_ 'o

L
?¥ ′,
ó ?? 7 ?
ü??¥′Q_1.

L
ó ?? 7 ?
ü??¥′Q_1.

L
?b


4
L???]¨?]¥
=i? í '
P ]
9

L???]¨?]¥
=i? í '
P ]
9
o??Yb
2.2f
¥ 3*?B?¨
2.2.1f
¥ 3*?¨
f
¥ 3*?¨
f
¥ 3*?¨
^·3?$?¨f
H$?
¥ 3*?¨
^·3?$?¨f
H$?
¨f
? ?¨
 
f
b?D 
?y¥0?? 3*
?
b?D 
?y¥0?? 3*
?¨¥ f?
^ ?
¥ 1" VV
U ?m
?¨¥ f?
^ ?
¥ 1" VV
U ?m
2-1b
[? è
? è
2.4] 9
9
s=1
k
+2
k
+3
k
+……+N
k
/*?
f
¥ 3*?¨
?
f
¥ 3*?¨
*/
#define K 4
#define N 5
long f1(int n,int k) /*9
9
n¥ kQZ */
{ long power=n;
int i;
for(i=1;i<k;i++) power *= n;
return power;
}
long f2(int n,int k)/*9
9
1? n¥ kQZ- ?F */
{ long sum=0;
int i;
for(i=1;i<=n;i++) sum += f1(i,k);
return sum;
}
main()
{ printf("Sum of %d powers of integers from 1 to %d =
",K,N);
printf("%d\n",f2(N,K));
getch();
}
???
???


3

2.2.2f
¥?B?¨
f
¥?B?¨
f
¥?B?¨
^·B?f

¥f
8
=°¤W¤1?¨
1
&b
=°¤W¤1?¨
1
&b
(?y
?f
¥?B?¨b?B?¨?
?¨f
?
^$?¨f
3??Bf
|Qˉ?
¨ 1
&b
?¨BQüé ??¥Bab
1
]??B?¨í??1é?A?f
=μ???B?¨¥
m
b訥÷E
^FHq

@
?Hqaü?T?B?¨ ?a?a

@
?Hqaü?T?B?¨ ?a?a
Ríb
[? è
? è
2.5] ¨?BE9
n!b
/*?
YVf
¥?B?¨9
¨e
?
YVf
¥?B?¨9
¨e
*/
long power(int n)
{ long f;
if(n>1) f=power(n-1)*n;
else f=1;
return(f);
}
main()
{ int n;
long y;
printf("input a inteager number:\n");
scanf("%d",&n);
y=power(n);
printf("%d!=%ld\n",n,y);
getch();
}
?????? 

4
2.3
FT1f
?
F¨Tf
?

??
TB?
^ü
F¨Tf
?

??
TB?
^ü
Fí
í
??/SM
T1
L?
P¨
6B
Fí
í
??/SM
T1
L?
P¨
6B
?
^ü
F
T1f
¥??
L?
P¨b
?
^ü
F
T1f
¥??
L?
P¨b
2.3.1
Fí
íT1f
?
Fí
íT1f
?
2.3.2
F
T1f
¥??
L?
F
T1f
¥??
L?
2.3.1
Fí
íT1f
?
Fí
íT1f
?
Fí
íü
^/SM

D
YM
ií uYb
Fí
íü
^/SM

D
YM
ií uYb
Fí
ío
¨Tf
L? ¨ED
YM
?
Fí
ío
¨Tf
L? ¨ED
YM
?
?M]?
3f
?¨
Hü
Fí
í¥′.
?M]?
3f
?¨
Hü
Fí
í¥′.
ó??
LC?_′.
b
ó??
LC?_′.
b
[? è
? è
2.6] Bf
d93?1?3
¥?
b
/*?

Fí
íT1f
L?
?

Fí
íT1f
L?
*/
int isalp(char c)
{ if (c>='a'&&c<='z'||c>='A'&&c<='Z')
return(1);
else return(0);
}
main()
{ int i,num=0;
char str[255];
printf("Input a string,");
gets(str);
for(i=0;str[i]!='\0';i++)
if (isalp(str[i])) num++;
puts(str);
printf("num=%d\n",num);
getch();
}
?????? 

5
a
ü
a
ü


1¨
Fí
íT
L?
Ho1
F ??
¨
Fí
íT
L?
Ho1
F ??
f
¥?? ??Bá' Vi?1 pf
¥??
f
¥?? ??Bá' Vi?1 pf
¥??
9
^/SM
bD 
a
Fí
í¥) ?
^
?
YM
?¥b


2
YM
/SM
Tf
?
H 

YM
/SM
Tf
?
H 
??M

L?M

^?Ir"ds
¥¥
??
??M

L?M

^?Ir"ds
¥¥
??
]¥
=i?íbf
?¨
H?
3¥′.

^

L?M
¥′?í??M
b

L?M
¥′?í??M
b
2.3.2
F
T1f
¥??
L?
F
T1f
¥??
L?
F
Tf
?
H; V[T??9 V[
F
Tf
?
H; V[T??9 V[
T
L?b
F
Tf
?
H1 p??M?¥
L
??A?
^ ??M]¥
F
·_
F ¥·?M
??A?
^ ??M]¥
F
·_
F ¥·?M
?A?μ
ü ?¥
F
a
ü
?A?μ
ü ?¥
F
a
ü
[? è
? è
2.7] X?
?D
3
X?
?D
3
5
ê [?¥? p
ü (?b
ê [?¥? p
ü (?b
float aver(float a[ ]) /* p
ü (′f
p
ü (′f
*/
{ int i

float av,s=a[0]

for(i=1

i<5

i++) s += a[i]

av=s/5

return av

}
void main()
{ float sco[5],av

int i

printf("\ninput 5 scores:\n")

for(i=0

i<5

i++) scanf("%f",&sco[i])

av=aver(sco)/*?¨f
L?1
F

?¨f
L?1
F

*/
printf("average score is %5.2f\n",av)

getch();
}
?????? 

6
a
ü 

1¨
F
Tf
?
???¨f
$?
¨f
? s Y ? l
F O
??A?Bá?52
T|pb è ?'? è???
F1 a[]
L?
F1 sco[]
ì¥
??M]b

2 CIr"d??
Fvl?T_°
[?
?
F V [? ·?vlb è ?'? è?¥??
F a[]b
?T·???
F¥vl5
L ?
F¥ vl A?
v ? ? ? ? ?
F ?5y??
F¥?sí
í
àμ ?
?′7?á9
2Tpb
2.4
=?M
D??M

=?M
D??M

(?y?
μ¥M
?μ1-¥T¨×bM
(?y?
μ¥M
?μ1-¥T¨×bM

a
ü¥ê??] T¨×9?] N|

a
ü¥ê??] T¨×9?] N|
(?y?¥M
s1
=?M
??M
b
(?y?¥M
s1
=?M
??M
b
2.4.1
=?M

=?M

2.4.2 ??M

??M

2.4.1
=?M

=?M

B?f
=?
a
ü¥M

^
=?M

B?f
=?
a
ü¥M

^
=?M

o?f
S?
=μrb
o?f
S?
=μrb
9ü
^
a o μcM

a
ü¥f
=
9ü
^
a o
??
P¨$
a
ü¥M
Nf
-?ü ?
??
P¨$
a
ü¥M
Nf
-?ü ?
P¨?tM

b
[
=?M
9?
P¨?tM

b
[
=?M
9?
“ ?M
?M


”b
è ?
è ?
int f1(int a) /*f
f1*/
{ int b,c

……
} /*a,b,cT¨×?K?f
T¨×?K?f
f1()?
?
*/
int f2(int x) /*f
f2*/
{ int y,z

……
} /*x,y,zT¨×?K?f
T¨×?K?f
f2()?
?
*/
main()
{ int m,n

……
} /*m,nT¨×?K?f
T¨×?K?f
main()?
?
*/
1? ?M
¥T¨×1
a
ü[/+?
1? ?M
¥T¨×1
a
ü[/+?
1?f
main()?? l¥
=?M
9o

=?M
9o

?f
?
P¨ 
f
?
P¨b]
H?f
?f
?
P¨ 
f
?
P¨b]
H?f
?9?
P¨ 
f
??l¥
=?M
b?B?
?9?
P¨ 
^D 
?y?]¥?í[?ib
^D 
?y?]¥?í[?ib
2??M
9
^
=? M

?$?¨f

??M
9
^
=? M

?$?¨f

L?M
5
^?¨f
¥
=?M
b
L?M
5
^?¨f
¥
=?M
b
3
??]¥f
?
P¨M]¥M



??]¥f
?
P¨M]¥M


ì}V?]¥ `s
¥?]¥?ío?? ?
`s
¥?]¥?ío?? ?
9??
3jb
9??
3jb
2.4.2 ??M

??M

f
???l¥M
?1??M
b[N
f
???l¥M
?1??M
b[N
?wf
???l¥
Fü?1??
Fb
?wf
???l¥
Fü?1??
Fb
??M
?
? ?B?f
 
??M
?
? ?B?f
 
T¨×
T¨×
^
^
V??M
¥?lê? 7
S ?'óq2
1?b
V??M
¥?lê? 7
S ?'óq2
1?b
??M
 V$T¨×
=¥
μf
° ¤ ?
° ¤ ?
¨
[??M
?? ? M
b
¨
[??M
?? ? M
b
[? è 2.9]
{ ?éZ8¥é
la z
waú
h p
éZ88#?a§a? ??
¥
b
/*?
 ?¨ ? M
9
éZ8¥8# ??
¥
 */
int s1,s2,s3;
int vs(int a,int b,int c)
{ int v;
v=a*b*c; s1=a*b; s2=b*c; s3=a*c;
return v;
}
main()
{int v,l,w,h;
clrscr();
printf("\ninput length,width and height ");
scanf("%d%d%d",&l,&w,&h);
v=vs(l,w,h);
printf("v=%d s1=%d s2=%d s3=%d\n",v,s1,s2,s3);
getch();
}
?????? 

7
? ? M
μ[/+?
a
ü
? ? M
μ[/+?
a
ü


1??M
 VF <f
 v-W¥
ó " ??
??M
 VF <f
 v-W¥
ó "
P? tf
G ??t??M
y7
P¤?tf
¥? ?
P? tf
G ??t??M
y7
P¤?tf
¥? ?
???b
V
 v??
!9¥4? ? A?
^? ?¥yN?
^
4? ? A?
^? ?¥yN?
^
d¨? V
H?1
P¨??M
b
d¨? V
H?1
P¨??M
b


2]B÷óq?
???M

=?M
]
b
]B÷óq?
???M

=?M
]


=?M
¥T¨×
=??M
|$
à77? T¨b

=?M
¥T¨×
=??M
|$
à77? T¨b


3??M
¥T¨×
^V?l??'óq2
b ?
??M
¥T¨×
^V?l??'óq2
b ?
T? l?- -¥f
31?¨?t??M

H31f
l?- -¥f
31?¨?t??M

H31f
= $?¨¥??M
é?
a
üb??M

a
ü¥B?
= $?¨¥??M
é?
a
üb??M

a
ü¥B?
?
T1
?
T1
extern
??
??
??M

??M

[??M

??M

2……]

[? è
? è
2.10] ??M
¥?lD
a
üb
??M
¥?lD
a
üb
int vs(int xl,int xw)
{ extern int xh

/*??M

??M

xh¥
a
ü
¥
a
ü
*/
int v

v=xl*xw*xh

/*°¤
P¨??M

°¤
P¨??M

xh¥′ */
return v

}
main()
{ extern int xw,xh

/*??M
¥
a
ü
??M
¥
a
ü
*/
int xl=5

/*
=?M
¥?l
=?M
¥?l
*/
}
2.5
=?f
??f
=?f
??f
?B?÷?? ??÷óqF?
H(?y? f
?$ 
÷óq?¥f
?¨|f
s1
=?f

??f
b
? 2.5.1
=?f

??á
f

=?f

??á
f

? 2.5.2 ??f
??f
? 2.5.3 ?÷??óq¥Ir ?¤?÷??óq¥Ir ?¤
2.5.1
=?f

??á
f

=?f

??á
f

?T B?÷óq??l¥f
o
$'óq?¥f
?¨7?
$]B? ? 
ó q?¥f
?¨??f
?1
=?f
b
?l B?
=?f
o3f
?? -FB?,static”1
o3' V ?/
U
staticf
??f
(f
?
V )
{……}
1o3,static”r??óü
^,á
¥,
[
=?f
?
?á
f
b?N),staticӴcl?
^·i%Z
T7
^·
f
¥T¨×? K?'óqb
P¨
=?f
¥z)
^?]¥ |I?]¥f
H?
¨??1-?l¥f

^ ? D 
óq?¥f
]

y1]
9
àμ1"b
2.5.2 ??f
??f
??f
¥?l?lf
H ?T
àμF1o3
??f
¥?l?lf
H ?T
àμF1o3
“static”

3[1o3,extern”

V
UNf
^??f

V
UNf
^??f

[extern]f
??
f
??
f

f

(f
?
V
f
?
V
)
{……}
?¨??f
H31 é?
a
ü
?¨??f
H31 é?
a
ü
[extern]f
??
f
??
f

f

(?
??V
?
??V
)[f

f

2(?
?
?
?
?V
?V
2)……]

[? è
? è
2.11] ??f
?¨b
??f
?¨b
main()
{ extern void input(…),process(…),output(…);
input(…); process(…); output(…);
}


2

óq
óq
subf1.c
……
extern void input(……) /*?l??f
?l??f
*/
{……}


3óq
óq
subf2.c
……
extern void process(……) /*?l??f
?l??f
*/
{……}


4óq
óq
subf3.c
……
extern void output(……) /*?l??f
?l??f
*/
{……}
2.6 M
¥?
i%Dá
i%eo
M
¥?
i%Dá
i%eo
(?y?M
¥i% ??
a
üμ [
(?y?M
¥i% ??
a
üμ [
/
1?1?M
 (auto)a7i M

(register)a??M

??M

(extern)aá
M


M

(static)b
1?M
7i M

??
i%Z
T?
1?M
7i M

??
i%Z
T?
?M
á
=?M

?á
i%Z
Tb
?M
á
=?M

?á
i%Z
Tb
? 2.6.1
=?M
¥i%Z
T
=?M
¥i%Z
T
? 2.6.2 ??M
¥i%Z
T??M
¥i%Z
T
2.6.1
=?M
¥i%Z
T
=?M
¥i%Z
T
1á
i% aa
aa

=?M


=?M



1?lì
T
?lì
T
static
??
??
=?M

=?M

V
V


2i%+?
1á
=?M

?á
i%b?? 3?V
á
=?M

?á
i%b?? 3?V
??'
P
f
?¨2
9?
dbbD 
a??3?
ùWá
=?M

S?i
a??3?
ùWá
=?M

S?i
? 
f
^?
?¨
ì¥b
? 
f
^?
?¨
ì¥b
2?l??
S51??[ "

"
??

??

L?

L?
'\0'
3?? O
Q?¨
ì


3?? O
Q?¨
ì

¥f
H?×??′o
^
=
Q?¨
¥f
H?×??′o
^
=
Q?¨
2
H¥′
2
H¥′
2 ?
i% aa1? ?M

??1?M


1 ?lì
T  [auto]
?? M
V 

2 i%+?
11?M

??
i%Z
Tbf
??l¥1?M
  o  ?f
= μ r f
$?¨
Hs
¥i% bW?¨2

dbb
ˉ? ??l¥ 1?M
o?ˉ? ?μr |
ˉ? a9?

P¨?5|? p
2? l7 ?
S5 ′
^? ??¥b ?T
S5
?  ′ ? T
^  ? ¨
H é ? ¥ O
Q?¨?1×??BQ
′b
3? ?1 ?M
¥T¨×
3i
ù? K??l
¥?
8
= 
f
ˉ ?    yN?]¥?8?
?
P¨]
¥
M
 7 ?  j b'
P f
=?l¥1?M
9 VD?f
=?¥ˉ? ??l¥1?M
]
b
yp "d?ji?i?" |9?j
[D

¨]
1?M

[? è
? è
2.13]1?M
Dá
?M
¥i%+?b
void auto_static(void)
{ int var_auto=0; /*
Q?¨?×?
S */
static int var_static=0; /*á
?M
o
S

?M
o
S
1Q */
printf(“var_auto=%d,var_static=%d\n”,var_auto,
var_static);
++var_auto;
++var_static;
}
main()
{ int i;
for(i=0; i<5; i++) auto_static();
}
3 7i i% aa7i M

B ? f ?/M
¥′?
^i%
=i?¥b14ú
3?r
q(?y
?| ?M
¥′ib?7i ?
??M
ü?17i M
b?lì
T ?/
register
?? M
V

1oμ ?M
?
?l?7i M
' ? M
??b

27i M
¥
L=) ?
"d7sb è ?
±
¥ MSC TC |7i M

L=?T1?M
) ?b

3
?
P¨¥7i 
"
^μK ¥?
?l ?i
?7i M
b
2.6.2 ??M
¥i%Z
T
??M
¥i%Z
T
??M

?á
i%Z
T
??M

?á
i%Z
T


1á
??M

á
??M

aa
aa
o
?$'÷óq?
o
?$'÷óq?
¥f
?¨
¥f
?¨
?lì
T1
?lì
T1
static
??
??
??M

??M

V
V


2dá
??M

dá
??M

aa
aa

?$ 
÷ó q

?$ 
÷ó q
?¥f
?¨
?¥f
?¨
?l
H ?
8
?l
H ?
8
static1o3¥??M
'1d
1o3¥??M
'1d

??M
b 
÷óq?¥f
?¨dá

??M
b 
÷óq?¥f
?¨dá
??M

H31?¨f
¥÷óq?
??M

H31?¨f
¥÷óq?
é?
a
ü
é?
a
ü
extern
??
??
??M
V
??M
V

?M
á
?? M
]

i%Z
T?

? uY?v

1?l¥ê??]bá
?M
f
=?l 

??M
f
??lb

2T¨×?]bá
?M

?
=?M
  T
¨×?K??l
¥f
=
ù ?
3i
ù1??÷??
? 
f
^?
P¨
¥b

??M
f
?? l T¨×1?l
¥÷ó
q
=
3i
ù1??÷??? 
÷óq?¥f
9
^
?
P¨
¥b

3
S) ??]bá
?M
?? 1Q?

¥f
H$
S?Q?¨?l
¥f
H?
S7
^
=
 1Q?¨2
H¥′b7á
??M

^f
??l¥?iá
=?M
¥,×ˉ,

Sù5 ? -′?Kí 1Qó
?′¥?T %?b
A 1, ü ?M
?M1á
=?M
a
?M

¥i %Z
T'?M

¥
3i
ùbü??
M
?M1á
??M
a?M

¥T¨×K
?

¥
P¨S?byN1o3,static”?]¥1
Z
¥T¨
^?]¥b
C?y??
!92
?y??
!92
?
¨?2?¨1 ??y
í
b
¨?2?¨1 ??y
í
b
? ê42
ê42
? IF-ELSE2
if Hq
Hq
) ? S1
else
) ? S2
? SWITCH-CASE 2
switch(a)
{
case a1:
) ? S1;
break;
case a2:
) ? S2;
break;
.
.
.
default:
) ? SN

break;
}
? ?ì2
? FOR2
for(
SHq ?ìHq ?ìM
9′

SHq ?ìHq ?ìM
9′
)
?ì8
?ì8
? WHILE2
While
?ìHq

?ìHq
? ?i?i  continue break¨E ¨E
 p ???
f
b
! ???Hé1BaCaD
BSFB¥
E
????bIB??????a
n5
à
A
U ?/???
{ ?
′a?¨A
U,”m?
¥f
??
{ ?
′a?¨A
U,”m?¥f
??
{ ?
′a2
??b
L