//2015年7月26日21:43:30
//原始的冒泡排序
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
int main()
{
system("color 0a");
int i;
int j;
int temp;
int arr[10]={9,6,5,4,7,8,3,1,2,0};
for(i=0; i<9; i++){
for(int j=0; j<9-i; j++){
if(arr[j] > arr[j+1]){
temp = arr[j];
arr[j] = arr[j+1];
arr[j+1] = temp;
}
}
}
for(i=0; i<10; i++){
printf("%d",arr[i]);
}
system("pause");
return 0;
}
//原始的冒泡排序
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
int main()
{
system("color 0a");
int i;
int j;
int temp;
int arr[10]={9,6,5,4,7,8,3,1,2,0};
for(i=0; i<9; i++){
for(int j=0; j<9-i; j++){
if(arr[j] > arr[j+1]){
temp = arr[j];
arr[j] = arr[j+1];
arr[j+1] = temp;
}
}
}
for(i=0; i<10; i++){
printf("%d",arr[i]);
}
system("pause");
return 0;
}