automated commit TP4 + Doc
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
#include "printlib.h"
|
||||
|
||||
int main() {
|
||||
println_int(42);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// EXPECTED
|
||||
// 42
|
||||
@@ -0,0 +1,11 @@
|
||||
#include "printlib.h"
|
||||
|
||||
int main() {
|
||||
|
||||
int x,y;
|
||||
x=4;
|
||||
y=12+x;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// EXPECTED
|
||||
@@ -0,0 +1,11 @@
|
||||
#include "printlib.h"
|
||||
|
||||
int main() {
|
||||
|
||||
int a,n;
|
||||
n=1;
|
||||
a=n+12;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// EXPECTED
|
||||
@@ -0,0 +1,11 @@
|
||||
#include "printlib.h"
|
||||
|
||||
int main() {
|
||||
|
||||
int n;
|
||||
n=6;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// EXPECTED
|
||||
@@ -0,0 +1,11 @@
|
||||
#include "printlib.h"
|
||||
|
||||
int main() {
|
||||
|
||||
println_int(43);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// EXPECTED
|
||||
// 43
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
#include "printlib.h"
|
||||
|
||||
int main() {
|
||||
|
||||
int x;
|
||||
x = 42;
|
||||
println_int(x);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// EXPECTED
|
||||
// 42
|
||||
@@ -0,0 +1,16 @@
|
||||
#include "printlib.h"
|
||||
|
||||
int main() {
|
||||
|
||||
int x;
|
||||
x = 42;
|
||||
println_int(x + x);
|
||||
println_int(x + 1);
|
||||
println_int(1 + x);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// EXPECTED
|
||||
// 84
|
||||
// 43
|
||||
// 43
|
||||
@@ -0,0 +1,20 @@
|
||||
#include "printlib.h"
|
||||
|
||||
int main() {
|
||||
|
||||
int x, y;
|
||||
x = 42;
|
||||
y = 66;
|
||||
println_int(x + y);
|
||||
x = 1;
|
||||
println_int(x + y);
|
||||
y = 2;
|
||||
println_int(x + y);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// EXPECTED
|
||||
// 108
|
||||
// 67
|
||||
// 3
|
||||
|
||||
@@ -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
|
||||
@@ -0,0 +1,18 @@
|
||||
#include "printlib.h"
|
||||
|
||||
int main() {
|
||||
|
||||
int a,n;
|
||||
|
||||
n = 1;
|
||||
a = 7;
|
||||
while (n < a) {
|
||||
n = n+1;
|
||||
}
|
||||
println_int(n);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// EXPECTED
|
||||
// 7
|
||||
@@ -0,0 +1,9 @@
|
||||
int main() {
|
||||
float f;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// SKIP TEST EXPECTED
|
||||
// EXITCODE 5
|
||||
// EXPECTED
|
||||
// Unsupported type float
|
||||
@@ -0,0 +1,9 @@
|
||||
int main() {
|
||||
println_float(0.0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// SKIP TEST EXPECTED
|
||||
// EXITCODE 5
|
||||
// EXPECTED
|
||||
// Unsupported type float
|
||||
@@ -0,0 +1,9 @@
|
||||
int main() {
|
||||
println_string("Hello");
|
||||
return 0;
|
||||
}
|
||||
|
||||
// SKIP TEST EXPECTED
|
||||
// EXITCODE 5
|
||||
// EXPECTED
|
||||
// Unsupported type string
|
||||
@@ -0,0 +1,9 @@
|
||||
int main() {
|
||||
string b;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// SKIP TEST EXPECTED
|
||||
// EXITCODE 5
|
||||
// EXPECTED
|
||||
// Unsupported type string
|
||||
@@ -0,0 +1 @@
|
||||
Add your own tests in this directory.
|
||||
Reference in New Issue
Block a user