Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • theo.putegnat/infosec-ecomp
  • damien.armillon/infosec-ecomp
  • mouhamed.sougou/infosec-ecomp
  • cidre-public/compilation/infosec-ecomp
4 results
Show changes
Showing
with 280 additions and 95 deletions
{"output": "12\n5\n", "error": null, "retval": 0}
\ No newline at end of file
{"output": "12\n5\n", "error": null, "retval": 0}
\ No newline at end of file
SYM_INT
SYM_IDENTIFIER(swap)
SYM_LPARENTHESIS
SYM_INT
SYM_ASTERISK
SYM_IDENTIFIER(t)
SYM_COMMA
SYM_INT
SYM_IDENTIFIER(i)
SYM_COMMA
SYM_INT
SYM_IDENTIFIER(j)
SYM_RPARENTHESIS
SYM_LBRACE
SYM_INT
SYM_IDENTIFIER(tmp)
SYM_ASSIGN
SYM_IDENTIFIER(t)
SYM_LBRACKET
SYM_IDENTIFIER(i)
SYM_RBRACKET
SYM_SEMICOLON
SYM_IDENTIFIER(t)
SYM_LBRACKET
SYM_IDENTIFIER(i)
SYM_RBRACKET
SYM_ASSIGN
SYM_IDENTIFIER(t)
SYM_LBRACKET
SYM_IDENTIFIER(j)
SYM_RBRACKET
SYM_SEMICOLON
SYM_IDENTIFIER(t)
SYM_LBRACKET
SYM_IDENTIFIER(j)
SYM_RBRACKET
SYM_ASSIGN
SYM_IDENTIFIER(tmp)
SYM_SEMICOLON
SYM_RETURN
SYM_INTEGER(0)
SYM_SEMICOLON
SYM_RBRACE
SYM_INT
SYM_IDENTIFIER(main)
SYM_LPARENTHESIS
SYM_RPARENTHESIS
SYM_LBRACE
SYM_INT
SYM_IDENTIFIER(t)
SYM_LBRACKET
SYM_INTEGER(10)
SYM_RBRACKET
SYM_SEMICOLON
SYM_IDENTIFIER(t)
SYM_LBRACKET
SYM_INTEGER(0)
SYM_RBRACKET
SYM_ASSIGN
SYM_INTEGER(5)
SYM_SEMICOLON
SYM_IDENTIFIER(t)
SYM_LBRACKET
SYM_INTEGER(1)
SYM_RBRACKET
SYM_ASSIGN
SYM_INTEGER(12)
SYM_SEMICOLON
SYM_IDENTIFIER(swap)
SYM_LPARENTHESIS
SYM_IDENTIFIER(t)
SYM_COMMA
SYM_INTEGER(0)
SYM_COMMA
SYM_INTEGER(1)
SYM_RPARENTHESIS
SYM_SEMICOLON
SYM_IDENTIFIER(print)
SYM_LPARENTHESIS
SYM_IDENTIFIER(t)
SYM_LBRACKET
SYM_INTEGER(0)
SYM_RBRACKET
SYM_RPARENTHESIS
SYM_SEMICOLON
SYM_IDENTIFIER(print)
SYM_LPARENTHESIS
SYM_IDENTIFIER(t)
SYM_LBRACKET
SYM_INTEGER(1)
SYM_RBRACKET
SYM_RPARENTHESIS
SYM_SEMICOLON
SYM_RETURN
SYM_INTEGER(0)
SYM_SEMICOLON
SYM_RBRACE
SYM_EOF
int main(int argc,char* argv[]){
int t[10];
t[0] = 5;
t[1] = 12;
partition(t,0,1,0);
print(t[0]);
print(t[1]);
return 0;
}
int swap(int* t,int i,int j){
int tmp = t[i];
t[i] = t[j];
t[j] = tmp;
return 0;
}
int partition(int* t, int begin, int end, int pivot){
int tmp = t[pivot];
t[pivot] = t[end];
t[end] = tmp;
int j = begin;
int i = begin;
while(i <= end - 1){
if(t[i] <= t[end]){
tmp = t[i];
t[i] = t[j];
t[j] = tmp;
j = j + 1;
}
i = i + 1;
}
tmp = t[end];
t[end] = t[j];
t[j] = tmp;
return j;
}
int swap(int* t,int i,int j){
int tmp = t[i];
t[i] = t[j];
t[j] = tmp;
return 0;
}
int main(int argc,char* argv[]){
int t[10];
t[0] = 12;
t[1] = 5;
int begin = 0;
int end = 1;
int pivot = 0;
swap(t, pivot, end);
int j = begin;
int i = begin;
while(i <= end - 1){
if(t[i] <= t[end]){
swap(t, i, j);
j = j + 1;
} else {
}
i = i + 1;
}
swap(t, end, j);
print (j);
print (t[0]);
print (t[1]);
return 0;
}
int swap(int* t,int i,int j){
int tmp = t[i];
t[i] = t[j];
t[j] = tmp;
return 0;
}
int main(int argc,char* argv[]){
int t[10];
t[0] = 12;
t[1] = 5;
swap(t, 0,1);
int j = 0;
if(t[0] <= t[1]){
swap(t, 0, 0);
j = j + 1;
} else {
}
swap(t, 1, 1);
print (j);
print (t[0]);
print (t[1]);
return 0;
}
main(n, m){
a = 10;
b = 20;
if (3 > n){
x = a;
} else {
x = b;
}
return x;
}
f(x){
n = 3;
return 3 * x;
}
{"output": "", "error": null, "retval": 20}
\ No newline at end of file
{"output": "", "error": null, "retval": 10}
\ No newline at end of file
SYM_IDENTIFIER(main)
SYM_LPARENTHESIS
SYM_IDENTIFIER(n)
SYM_COMMA
SYM_IDENTIFIER(m)
SYM_RPARENTHESIS
SYM_LBRACE
SYM_IDENTIFIER(a)
SYM_ASSIGN
SYM_INTEGER(10)
SYM_SEMICOLON
SYM_IDENTIFIER(b)
SYM_ASSIGN
SYM_INTEGER(20)
SYM_SEMICOLON
SYM_IF
SYM_LPARENTHESIS
SYM_INTEGER(3)
SYM_GT
SYM_IDENTIFIER(n)
SYM_RPARENTHESIS
SYM_LBRACE
SYM_IDENTIFIER(x)
SYM_ASSIGN
SYM_IDENTIFIER(a)
SYM_SEMICOLON
SYM_RBRACE
SYM_ELSE
SYM_LBRACE
SYM_IDENTIFIER(x)
SYM_ASSIGN
SYM_IDENTIFIER(b)
SYM_SEMICOLON
SYM_RBRACE
SYM_RETURN
SYM_IDENTIFIER(x)
SYM_SEMICOLON
SYM_RBRACE
SYM_IDENTIFIER(f)
SYM_LPARENTHESIS
SYM_IDENTIFIER(x)
SYM_RPARENTHESIS
SYM_LBRACE
SYM_IDENTIFIER(n)
SYM_ASSIGN
SYM_INTEGER(3)
SYM_SEMICOLON
SYM_RETURN
SYM_INTEGER(3)
SYM_ASTERISK
SYM_IDENTIFIER(x)
SYM_SEMICOLON
SYM_RBRACE
SYM_EOF
/** /**/
/** Commentaire ! */
main(){
return 23;
}
{"output": "", "error": null, "retval": 23}
\ No newline at end of file
{"output": "", "error": null, "retval": 23}
\ No newline at end of file
SYM_IDENTIFIER(main)
SYM_LPARENTHESIS
SYM_RPARENTHESIS
SYM_LBRACE
SYM_RETURN
SYM_INTEGER(23)
SYM_SEMICOLON
SYM_RBRACE
SYM_EOF
main(){
i = 10;
a = 2;
res = 0;
while(i > 0){
x = a + a;
if(a > 4){
res = res + x;
} else {
res = res - x;
}
i = i - 1;
}
return res;
}
{"output": "", "error": null, "retval": -40}
\ No newline at end of file
{"output": "", "error": null, "retval": -40}
\ No newline at end of file
SYM_IDENTIFIER(main)
SYM_LPARENTHESIS
SYM_RPARENTHESIS
SYM_LBRACE
SYM_IDENTIFIER(i)
SYM_ASSIGN
SYM_INTEGER(10)
SYM_SEMICOLON
SYM_IDENTIFIER(a)
SYM_ASSIGN
SYM_INTEGER(2)
SYM_SEMICOLON
SYM_IDENTIFIER(res)
SYM_ASSIGN
SYM_INTEGER(0)
SYM_SEMICOLON
SYM_WHILE
SYM_LPARENTHESIS
SYM_IDENTIFIER(i)
SYM_GT
SYM_INTEGER(0)
SYM_RPARENTHESIS
SYM_LBRACE
SYM_IDENTIFIER(x)
SYM_ASSIGN
SYM_IDENTIFIER(a)
SYM_PLUS
SYM_IDENTIFIER(a)
SYM_SEMICOLON
SYM_IF
SYM_LPARENTHESIS
SYM_IDENTIFIER(a)
SYM_GT
SYM_INTEGER(4)
SYM_RPARENTHESIS
SYM_LBRACE
SYM_IDENTIFIER(res)
SYM_ASSIGN
SYM_IDENTIFIER(res)
SYM_PLUS
SYM_IDENTIFIER(x)
SYM_SEMICOLON
SYM_RBRACE
SYM_ELSE
SYM_LBRACE
SYM_IDENTIFIER(res)
SYM_ASSIGN
SYM_IDENTIFIER(res)
SYM_MINUS
SYM_IDENTIFIER(x)
SYM_SEMICOLON
SYM_RBRACE
SYM_IDENTIFIER(i)
SYM_ASSIGN
SYM_IDENTIFIER(i)
SYM_MINUS
SYM_INTEGER(1)
SYM_SEMICOLON
SYM_RBRACE
SYM_RETURN
SYM_IDENTIFIER(res)
SYM_SEMICOLON
SYM_RBRACE
SYM_EOF
main(){
i = 20;
while(i > 0){
if(i < 5){
a = 5;
} else {
a = 6;
}
i = i - 1;
}
return i;
}
{"output": "", "error": null, "retval": 0}
\ No newline at end of file