void num1(){
int t = 0;
int a[5] = {4,3,7,9,2};
for(int i = 0;i<4;i++){
for(int j = i+1;j<5;j++){
if(a[i]<a[j]){
t = a[i];
a[i]=a[j];
a[j]=t; }
}
}
int main (){
int test = 0;
int t = 0;
int a[5]={3,5,2,6,9};
for (int i= 0;i<4;i++){
for(int j = i+1; j<5;j++){
t = 0;
if(a[i]<a[j]){
t = j; }
test = a[i];
a[i] = a[t];
a[t] = test;
}
}
}
|