sysy-data/functional/sy/21_if_test2.sy

25 lines
310 B
Plaintext
Raw Permalink Normal View History

2024-01-09 19:48:14 +08:00
// test if-else-if
int ifElseIf() {
int a;
a = 5;
int b;
b = 10;
if(a == 6 || b == 0xb) {
return a;
}
else {
if (b == 10 && a == 1)
a = 25;
else if (b == 10 && a == -5)
a = a + 15;
else
a = -+a;
}
return a;
}
int main(){
putint(ifElseIf());
return 0;
}