automated commit TP4 + Doc
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
#include "printlib.h"
|
||||
|
||||
int main() {
|
||||
|
||||
int x,y;
|
||||
|
||||
x = 9;
|
||||
if (x < 2)
|
||||
y=7;
|
||||
else
|
||||
y=12;
|
||||
x = y;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// EXPECTED
|
||||
@@ -0,0 +1,13 @@
|
||||
#include "printlib.h"
|
||||
|
||||
int main() {
|
||||
|
||||
int n;
|
||||
bool a,b;
|
||||
n=1;
|
||||
a=true;
|
||||
b=(a==(n<6));
|
||||
return 0;
|
||||
}
|
||||
|
||||
// EXPECTED
|
||||
@@ -0,0 +1,13 @@
|
||||
#include "printlib.h"
|
||||
|
||||
int main() {
|
||||
|
||||
int x,y;
|
||||
x=3;
|
||||
if (x<5) {
|
||||
y=x+1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// EXPECTED
|
||||
@@ -0,0 +1,16 @@
|
||||
#include "printlib.h"
|
||||
|
||||
int main() {
|
||||
|
||||
int x,y,z;
|
||||
x=2;
|
||||
if (x<3) {
|
||||
y=7;
|
||||
} else {
|
||||
y=8;
|
||||
}
|
||||
z=y+1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// EXPECTED
|
||||
@@ -0,0 +1,20 @@
|
||||
#include "printlib.h"
|
||||
|
||||
int main() {
|
||||
|
||||
int x,y,z,u;
|
||||
x=3;
|
||||
if (x < 4) {
|
||||
z=4;
|
||||
}
|
||||
else if ( x < 5) {
|
||||
z=5;
|
||||
}
|
||||
else {
|
||||
z=6 ;
|
||||
}
|
||||
u=z+1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// EXPECTED
|
||||
@@ -0,0 +1,19 @@
|
||||
#include "printlib.h"
|
||||
|
||||
int main() {
|
||||
|
||||
bool b;
|
||||
b = false;
|
||||
println_bool(b);
|
||||
b = true;
|
||||
println_bool(b);
|
||||
println_bool(true);
|
||||
println_bool(false);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// EXPECTED
|
||||
// 0
|
||||
// 1
|
||||
// 1
|
||||
// 0
|
||||
@@ -0,0 +1,10 @@
|
||||
#include "printlib.h"
|
||||
|
||||
int main() {
|
||||
|
||||
println_bool(3 >= 2);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// EXPECTED
|
||||
// 1
|
||||
@@ -0,0 +1,19 @@
|
||||
#include "printlib.h"
|
||||
|
||||
int main() {
|
||||
|
||||
if (10 == 10) {
|
||||
println_int(12);
|
||||
} else if (10 == 10) {
|
||||
println_int(15);
|
||||
} else {
|
||||
println_int(13);
|
||||
}
|
||||
println_int(14);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// EXPECTED
|
||||
// 12
|
||||
// 14
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
#include "printlib.h"
|
||||
|
||||
int main() {
|
||||
|
||||
int n;
|
||||
|
||||
n = 9;
|
||||
while (n > 0) {
|
||||
n = n-1 ;
|
||||
println_int(n) ;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// EXPECTED
|
||||
// 8
|
||||
// 7
|
||||
// 6
|
||||
// 5
|
||||
// 4
|
||||
// 3
|
||||
// 2
|
||||
// 1
|
||||
// 0
|
||||
Reference in New Issue
Block a user