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

26 lines
329 B
Plaintext
Raw Normal View History

2024-04-14 22:20:29 +08:00
#include "sylib.h"
// 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;
}