#include <stdio.h>
const int N=10;
int Liste[10]={5,3,2,8,12,1,32,-4,7,4};
void inversion(int n1, int n2) {
if (n1==n2)
return;
int temp=Liste[n1];
Liste[n1] = Liste[n2];
Liste[n2] = temp;
}
int main() {
int i,n=N;
while (n--!=1) {
int maxi=0;
for (i=0;i<=n;i++){
if (Liste[i]>Liste[maxi]){
maxi=i;
}
}
inversion(maxi,n);
}
for (i=0;i<10;i++)
printf(" %d -",Liste[i]);
}
To embed this project on your website, copy the following code and paste it into your website's HTML: