Commit a5be27ae authored by Wilke Pierre's avatar Wilke Pierre
Browse files

suppression de tests inutiles / non conformes à la spec du C

parent da593dcf
int main(int argc,char* argv[]){
int t[10];
int s[10];
t[10] = 3;
return s[0];
}
int main(int argc,char* argv[]){
int a = atoi(argv[1]);
int b = atoi(argv[2]);
int t[10];
t[0] = 5;
t[1] = 7;
t[2] = 3;
t[3] = 8;
t[4] = 12;
t[5] = 1;
t[6] = 4;
t[7] = 7;
t[8] = 2;
t[9] = 9;
sort(t,0,9);
int i = 0;
while(i < 10){
print(5000);
print(i);
print(t[i]);
i = i + 1;
}
return 0;
}
int sort(int* t, int begin, int end){
// print(10000+100*begin+end);
if (begin < end){
int pivot = begin;
pivot = partition(t, begin, end, pivot);
sort(t, begin, pivot-1);
sort(t, pivot+1, end);
}
}
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){
swap(t, pivot, end);
int j = begin;
int i = begin;
while(i <= end - 1){
//print(4000000+10000*i+end);
if(t[i] <= t[end]){
swap(t, i, j);
j = j + 1;
}
i = i + 1;
}
swap(t, end, j);
return j;
}
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;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment