$B$6$6Cn%m%4(J


$B#C8@8lF~Lg(J
Introduction of The C Programming Language

$B"%#C8@8lL\


$B!!$b$7$b!A$J$i!D!J(Jif $BJ8!K(J

$B!!%W%m%0%i%`$O!"@hF,9T$+$i=gHV$K=hM}$5$l$^$9$,!"(J $B$"$k>r7o$K$h$C$F=hM}FbMF$rJQ$($Fr7o<0(J ) $B$N8e$K$O(J ;$B!J%;%_%3%m%s!K(J$B$OIU$-$^$;$s!#(J $BIU$1$k$HM=A[$b$7$J$$$3$H$,5/$-$^$9!#(J $B$9$J$o$A!"$I$NJ8;z$rF~NO$7$F$bD+$N%a%C%;!<%8$,=PNO$5$l$^$9!#(J
$B!!$H$3$m$G!"%W%m%0%i%`$K$*$$$F>r7o<0$r5-=R$9$k$K$OI=(J3_1 $B$N4X781i;;;R$r;H$$$^$9!#(J

(IX=D(J3.1 $B>r7o$K$h$k%a%C%;!<%8=PNO!&$=$N#1(J --------------------------------------------------- #include <stdio.h> main() { $B!!!!(Jint a; $B!!!!(Ja = getchar(); /* a $B$K#1J8;zBeF~(J */ $B!!!!(Jif (a == 'm') /* $BF~NO$5$l$?J8;z$H(J m $B$,F1$8$+$I$&$+H=Dj(J */ $B!!!!!!!!(Jprintf("Good morning !!\n"); /* $B??$N;~(J,Good morning !!$B$H=PNO(J */ }

$B!|!!>r7oH=CG!!$b$7$b!A$J$i!D(J
$B!Z9=J8![(J$B!!!!(Jif ( $B>r7o<0(J ) {
$B!!!!!!!!!!!!!!!! $B!!!!!!!!!!!!(J}
$B=hM}$,#19T$N>l9g$O(J { } $B$O>JN,2DG=$G$9(J

$BI=(J3_1 $B4X781i;;;R(J
$B1i;;;R(J $B=q<0(J $B0UL#(J
< a < b a $B$,(J b $B$h$j>.$5$$$H$-??(J
<= a <= b a $B$,(J b $B$h$j>.$5$$$+Ey$7$$$$$H$-??(J
> a > b a $B$,(J b $B$h$jBg$-$$$H$-??(J
>= a >= b a $B$,(J b $B$h$jBg$-$$$+Ey$7$$$$$H$-??(J
== a == b a $B$H(J b $B$,Ey$7$$$H$-??(J
!= a != b a $B$H(J b $B$,Ey$7$/$J$$$H$-??(J

$B!!$b$7$b!A$J$i!D!"$=$&$G$J$$$J$i!D!J(J if else $BJ8!K(J

$B!!=hM}$NFbMF$rFsl9g$K5-=R$9$k9=J8$G$9!#(J $B>r7o<0$rI>2A$7$?7k2L$,!V??!W$N$H$-!"(Jif ($B>r7o<0(J) $B$KB3$/=hM}$,!"(J $B!V56!W$N$H$-(J else $B$KB3$/=hM}$,r7o<0(J ) $B$N8e$H!"(Jelse $B$N8e$K$O(J ; $B$OIU$-$^$;$s!#IU$1$k$H%(%i!<$,H/@8$7$^$9!#(J

(IX=D(J3.2 $B>r7o$K$h$k%a%C%;!<%8=PNO!&$=$N#2(J --------------------------------------------------- #include <stdio.h> main() { $B!!!!(Jint a; $B!!!!(Ja = getchar(); /* a $B$K#1J8;zBeF~(J */ $B!!!!(Jif (a == 'm') /* $BF~NO$5$l$?J8;z$H(J m $B$,F1$8$+$I$&$+H=Dj(J */ $B!!!!!!!!(Jprintf("Good morning !!\n"); /* $B??$N;~(J,Good morning !!$B$H=PNO(J */ $B!!!!(Jelse $B!!!!!!!!(Jprintf("Good night !!\n"); /* $B56$N;~(J,Good night !!$B$H=PNO(J */ }

$B!|!!>r7oH=CG!!$b$7$b!A$J$i!D!"$=$&$G$J$$$J$i!D(J
$B!Z9=J8![(J$B!!!!(Jif ( $B>r7o<0(J ) {
$B!!!!!!!!!!!!!!!! $B!!!!!!!!!!!!(J}
$B!!!!!!!!!!!!(Jelse {
$B!!!!!!!!!!!!!!!! $B!!!!!!!!!!!!(J}
$Bl9g$O(J { } $B$O>JN,2DG=$G$9(J

$B!!!V$b$7$b!A$J$i!D!W$,$?$/$5$s$"$k$H$-!J(J if-else if-else $BJ8!K(J

$B!!!V$b$7$b!A$J$i!D!W$H$$$&>r7oH=CG$,$?$/$5$s$"$k>l9g!"(Jelse if $BJ8$r$D$+$C$F5-=R$7$^$9!#(J $B$=$l$G$O!"0J2<$N(IX=D(J3.3$B$NDL$j$K%W%m%0%i%`$rF~NO!"J]B8!"%3%s%Q%$%k$7$Fl9g!"(JBad character !! $B$H%a%C%;!<%8$,<($5$l$^$9!#(J

(IX=D(J3.3 $B>r7o$K$h$k2C;;$H8:;;(J $B!J(Jif-else if-else$BJ8!K(J-------------------------------------------- #include <stdio.h> main() { $B!!!!(Jint a, b, c; $B!!!!(Ja = 12; /* a $B$K(J 12 $B$rBeF~(J */ $B!!!!(Jb = 5; /* b $B$K(J 5 $B$rBeF~(J */ $B!!!!(Jc = getchar(); /* c $B$K#1J8;zBeF~(J */ $B!!!!(Jif (c == '+') { /* $BF~NO$5$l$?J8;z$,(J + $B$+H=Dj(J */ $B!!!!!!!!(Jprintf("a + b = %d\n", a + b); /* + $B$N>l9g!$2C;;$N7k2L$r=PNO(J */ $B!!!!(J} $B!!!!(Jelse if (c == '-') { /* $BF~NO$5$l$?J8;z$,(J - $B$+H=Dj(J */ $B!!!!!!!!(Jprintf("a - b = %d\n", a - b); /* - $B$N>l9g!$8:;;$N7k2L$r=PNO(J */ $B!!!!(J} $B!!!!(Jelse { $B!!!!!!!!(Jprintf("Bad character !!\n"); /* + $B$G$b(J - $B$G$b$J$$>l9g(J, Bad character !!$B$H=PNO(J */ $B!!!!(J} }

$B!|!!>r7oH=CG!!!V$b$7$b!A$J$i!D!W$,$?$/$5$s$"$k$H$-(J
$B!Z9=J8![(J$B!!!!(Jif ( $B>r7o<0(J 1 ) {
$B!!!!!!!!!!!!!!!! $B!!!!!!!!!!!!(J}
$B!!!!!!!!!!!!(Jelse if ( $B>r7o<0(J2 ) {
$B!!!!!!!!!!!!!!!! $B!!!!!!!!!!!!(J}
$B!!!!!!!!!!!!!!!!!'(J
$B!!!!!!!!!!!!(Jelse {
$B!!!!!!!!!!!!!!!! $B!!!!!!!!!!!!(J}
$Bl9g$O(J { } $B$O>JN,2DG=$G$9(J

$B!!J#;($J9=J89=B$$K$J$k(J if else $BJ8!"(Jif-else if-else $BJ8$O!"(J $BI=(J3_2 $B$NO@M}1i;;;R$r;H$&$H!"(J if else $BJ8$K$*$$$F$9$C$-$j$7$?>r7o$N@_Dj$,2DG=$H$J$j$^$9!#(J

$BI=(J3_2 $BO@M}1i;;;R(J
$B1i;;;R(J $B1i;;(J $B=q<0(J $B0UL#(J
&& $BO@M}@Q(J $B<0#1(J && $B<0#2(J $B<0#1!"<0#2$,$H$b$K??$N$H$-??(J
|| $BO@M}OB(J $B<0#1(J || $B<0#2(J $B<0#1!"<0#2$N>/$J$/$H$b$I$A$i$+$,??$G$"$l$P??(J
! $BH]Dj(J !$B<0(J $B<0$,??!JCM#00J30!K$J$i56!"56!JCM#0!K$J$i??(J

$BO@M}1i;;;R$N;H$$J}(J
$B$&$k$&G/$O!"#4$G3d$j@Z$l$k!"$?$@$7(J 100 $B$G3d$j@Z$l$kG/$O$&$k$&G/$G$J$$!"(J $B$G$b(J 400 $B$G3d$j@Z$l$k$H$&$k$&G/(J
$B!|!!(Jif-else if-else $BJ8$K$h$k5-=R(J
if ( year % 400 == 0 ) {
$B!!!!(Jprintf("%d $BG/$O$&$k$&G/$G$9!#(J\n", yaer );
}
else if ( year % 100 == 0 ) {
$B!!!!(Jprintf("%d $BG/$O$&$k$&G/$G$O$"$j$^$;$s!#(J\n", year );
}
else if ( yaer % 4 == 0 ) {
$B!!!!(Jprintf("%d $BG/$O$&$k$&G/$G$9!#(J\n", yaer );
}
else {
$B!!!!(Jprintf("%d $BG/$O$&$k$&G/$G$O$"$j$^$;$s!#(J\n", year );
}
$B!|!!O@M}1i;;;R$r;H$C$?(J if else $BJ8$K$h$k5-=R(J
if ( ( ( year % 4 == 0 ) && ( year % 100 != 0 ) )
$B!!!!!!!!!!!!!!!!!!!!!!!!!!(J|| ( yaer % 400 == 0 ) ) {
$B!!!!(Jprintf("%d $BG/$O$&$k$&G/$G$9!#(J\n", yaer );
}
else {
$B!!!!(Jprintf("%d $BG/$O$&$k$&G/$G$O$"$j$^$;$s!#(J\n", year );
}






$B!!$?$/$5$s$+$i0l$D$rA*$V!J(J switch $BJ8!K(J

$B!!(IX=D(J3.3 $B>r7o$K$h$k2C;;$H8:;;(J $B!J(Jif-else if-else$BJ8!K$r!"(J $B=hM}%a%K%e!<$NCf$+$i#1$DA*$s$G $B!!$J$*!"(Jcase $BDj?t$N8e$O(J :$B!J%3%m%s!K(J$B$,IU$-$^$9!#(J $BJ8$N8e$KIU$/(J ; $B$H$O0c$&$N$GCm0U$,I,MW$G$9!#(J

(IX=D(J3.4 $B>r7o$K$h$k2C;;$H8:;;(J $B!J(Jswitch$BJ8!K(J--------------------------------------------- #include <stdio.h> main() { $B!!!!(Jint a, b, c; $B!!!!(Ja = 12; /* a $B$K(J 12 $B$rBeF~(J */ $B!!!!(Jb = 5; /* b $B$K(J 5 $B$rBeF~(J */ $B!!!!(Jc = getchar(); /* c $B$K#1J8;zBeF~(J */ $B!!!!(Jswitch (c) { $B!!!!!!!!(Jcase (IT(J+': /* $BF~NO$5$l$?J8;z$,(J + $B$+H=Dj(J */ $B!!!!!!!!!!!!(Jprintf("a + b = %d\n", a + b); /* + $B$N>l9g!$2C;;$N7k2L$r=PNO(J */ $B!!!!!!!!!!!!(Jbreak; $B!!!!!!!!(Jcase (IT(J-(IT(J : /* $BF~NO$5$l$?J8;z$,(J - $B$+H=Dj(J */ $B!!!!!!!!!!!!(Jprintf("a - b = %d\n", a - b); /* - $B$N>l9g!$8:;;$N7k2L$r=PNO(J */ $B!!!!!!!!!!!!(Jbreak; $B!!!!!!!!(Jdefault : /* + $B$G$b(J - $B$G$b$J$$>l9g(J, */ $B!!!!!!!!!!!!(Jprintf("Bad character !!\n"); /* Bad character !!$B$H=PNO(J */ $B!!!!!!!!!!!!(Jbreak; $B!!!!(J} }

$B!|!!>r7oH=CG!!!V$b$7$b!A$J$i!D!W$,$?$/$5$s$"$k$H$-(J
$B!Z9=J8![(J$B!!!!(Jswitch ( $BJQ?t(J ) {
$B!!!!!!!!!!!!!!!!(Jcase $BDj?t(J1:
$B!!!!!!!!!!!!!!!!!!!! $B!!!!!!!!!!!!!!!!!!!!(Jbreak;
$B!!!!!!!!!!!!!!!!(Jcase $BDj?t(J2:
$B!!!!!!!!!!!!!!!!!!!! $B!!!!!!!!!!!!!!!!!!!!(Jbreak;
$B!!!!!!!!!!!!!!!!!!!!!!!'(J
$B!!!!!!!!!!!!!!!!(Jdefault:
$B!!!!!!!!!!!!!!!!!!!! $B!!!!!!!!!!!!!!!!!!!!(Jbreak;
$B!!!!!!!!!!!!(J}
default: $B$N8e$N(J break; $B$O>JN,2DG=$G$9(J

$B!!(Jswitch $BJ8$G$O!"JQ?t$NCM$H0lCW$9$kDj?t$r5-=R$7$?(J case $BJ8(J$B$+$i!"(J $B:G=i$K=P2q$&(J break $BJ8(J$B$^$G$,r7o!JCM!K$K$*$$$FF10l$N=hM}$r9T$&$H$-$O$I$&$9$l$P$$$$$G$7$g$&!#(J $B$*$^$1!!NcJ8#1$NMM$K%W%m%0%i%`$7$^$9!#(J

$B$*$^$1!!NcJ8#1(J case $B@a$N=q$-J}(J ------------------------------------------------------------- /* * $B7n$rF~NO$9$k$H!"$=$N7n$NF|?t$,=PNO$5$l$k!#(J */ #include <stdio.h> main() { $B!!!!(J/* $BJQ?t$N@k8@(J */ $B!!!!(Jint month; // $B7n(J $B!!!!(J/* $B7n$rF~NO(J */ $B!!!!(Jprintf("$B2?7n$G$9$+!!(J"); $B!!!!(Jscanf("%d", &month); $B!!!!(J/* $BF|?t$r=PNO(J */ $B!!!!(Jswitch (month) { $B!!!!!!!!(Jcase 1: $B!!!!!!!!(Jcase 3: $B!!!!!!!!(Jcase 5: $B!!!!!!!!(Jcase 7: $B!!!!!!!!(Jcase 8: $B!!!!!!!!(Jcase 10: $B!!!!!!!!(Jcase 12: $B!!!!!!!!!!!!(Jprintf("31$BF|(J\n"); /* month $B$,(J 1, 3, 5, 7, 8, 10, 12 $B$N$H$-(J 31$BF|$H=PNO(J */ $B!!!!!!!!!!!!(Jbreak; $B!!!!!!!!(Jcase 4: $B!!!!!!!!(Jcase 6: $B!!!!!!!!(Jcase 9: $B!!!!!!!!(Jcase 11: $B!!!!!!!!!!!!(Jprintf("30$BF|(J\n"); /* month $B$,(J 4, 6, 9,11 $B$N$H$-(J 30$BF|$H=PNO(J */ $B!!!!!!!!!!!!(Jbreak; $B!!!!!!!!(Jcase 2: $B!!!!!!!!!!!!(Jprintf("28$BF|$^$?$O(J29$BF|(J\n"); /* month $B$,(J 2 $B$N$H$-(J 28$BF|$^$?$O(J29$BF|$H=PNO(J */ $B!!!!!!!!!!!!(Jbreak; $B!!!!!!!!(Jdefault: $B!!!!!!!!!!!!(Jprintf("$BIT@5$JCM$rF~NO$7$^$7$?!#(J\n"); /* 1$B!A(J12 $B0J30$N?tCM$N$H$-%a%C%;!<%8$r=PNO(J */ $B!!!!(J} }

$B!!>r7oH=CG$N%W%m%0%i%`$r:n@.$9$k$H$-!"(Jif $BJ8$^$?$O(J switch $BJ8$rMxMQ$7$^$9$,!"(J switch $BJ8$O(J if $BJ8$K=q$-49$($k$3$H$,2DG=$G$9$,!"(Jif $BJ8$r(J switch $BJ8$K=q$-49$($k$3$H$O!"(J $BI,$:$7$b2DG=$H$O$+$.$j$^$;$s!#(J

if $BJ8$H(J switch $BJ8$N0c$$(J
$B!|!!>r7o<0$HDj?t(J
$B!V$b$7$bDj?t(J a $B$NCM$,(J100$B$h$j$bBg$-$1$l$P!W$N$h$&$K!">r7o<0$rMQ$$$k>l9g$O(J if $BJ8$r;H$$$^$9!#(J
$B!V$b$7$bDj?t(J a $B$NCM$,(J100$B$H$*$J$8$J$i$P!W$N$h$&$K!"(J $BJQ?t$NCM$,Dj?t$HEy$7$$$+$rHf3S$9$k>l9g$O(J switch $BJ8$r;H$$$^$9!#(J
$B!|!!(Jif $BJ8(J $B!|!!(Jswitch $BJ8(J
if ( $B>r7o<0(J ) {
$B!!!!=hM}(J;
}



switch ( $BJQ?t(J ) {
$B!!!!(Jcase $BC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