properly handle relop and fix switch cases
This commit is contained in:
parent
b17f895f0a
commit
ae2337376c
4 changed files with 32 additions and 10 deletions
13
cpq.py
13
cpq.py
|
@ -18,11 +18,22 @@ a: int;
|
|||
{
|
||||
while(a < 10) {
|
||||
a = a + 1;
|
||||
if(a == 5)
|
||||
if(a >= 6 || a == 5)
|
||||
break;
|
||||
else
|
||||
a = a + 0;
|
||||
}
|
||||
output(a);
|
||||
switch(a * 5) {
|
||||
case 1:
|
||||
a = 5;
|
||||
break;
|
||||
case 5:
|
||||
output(a);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
output(a);
|
||||
|
||||
}
|
||||
'''
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue