以 う 繰 返し文 ループ 二重 い 場合 break文 ループをひ だけ抜けます
while(…){ while(…){ if(…){ break; } … } …
// break 後 ここ 始ま
… }
29
E:¥myc>notepad hellobreakcontinue.c E:¥myc>cl hellobreakcontinue.c
…
/out:hellobreakcontinue.exe hellobreakcontinue.obj
E:¥myc>hellobreakcontinue.exe
0以 数値を入力(残 10回 0 終了):1 0以 数値を入力(残 9回 0 終了):2 0以 数値を入力(残 8回 0 終了):3 0以 数値を入力(残 7回 0 終了):0 合計:6
E:¥myc>hellobreakcontinue.exe
0以 数値を入力(残 10回 0 終了):-1 0以 数値を入力(残 10回 0 終了):5 0以 数値を入力(残 9回 0 終了):4 0以 数値を入力(残 8回 0 終了):3 0以 数値を入力(残 7回 0 終了):0 合計:12
30
31
switch文 機能 if文 カバー ます
32
Z:¥myc>notepad helloswitch.c Z:¥myc>cl helloswitch.c
…
/out:helloswitch.exe helloswitch.obj
Z:¥myc>helloswitch.exe 1-3? : 1
A
Z:¥myc>helloswitch.exe 1-3? : 2
B
Z:¥myc>helloswitch.exe 1-3? : 5
Z
Z:¥myc>helloswitchif.exe 1-3? : 1
A
Z:¥myc>helloswitchif.exe 1-3? : 2
B
Z:¥myc>helloswitchif.exe 1-3? : 5
Z