-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathBoolTest02.lemon
More file actions
49 lines (48 loc) · 892 Bytes
/
BoolTest02.lemon
File metadata and controls
49 lines (48 loc) · 892 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
class BoolTest02{
void main(){
bool b1;
bool b2;
bool b3;
int i1;
int i2;
int i3;
int n1;
float f1;
b1 = true;
b2 = testBoolCall(false);
b3 = !(b1) && b2 || !(b2);
n1 = (1+2)*(3-4)/(5+9);
if (b1) {
i1 = 1;
} else {
i1 = 0;
}
if (b2) {
i2 = 1;
} else {
i2 = 0;
}
if (b3) {
i3 = 1;
} else {
i3 = 0;
}
printf("b1=%d,b2=%d,b3=%d", i1, i2, i3);
}
bool testBoolCall(bool b){
bool rs;
bool c;
c = false;
if( c ) {
rs = !(b);
}else{
rs = b;
}
if( (3+4) > 5 ){
rs = true;
}else{
rs = false;
}
return rs;
}
}