if / else
if (x > 0) {
} else if (x == 0) {
} else {
}
switch
switch (op) {
case 1: break;
default: break;
}
for / while
for (int i = 0; i < n; i++) { }
while (scanf("%d", &n) == 1 && n) { }
break / continue
与 C++ 相同。
if、switch、for、while
if (x > 0) {
} else if (x == 0) {
} else {
}
switch (op) {
case 1: break;
default: break;
}
for (int i = 0; i < n; i++) { }
while (scanf("%d", &n) == 1 && n) { }
与 C++ 相同。