摘要: 1 #include 2 #include 3 #include 4 using namespace std; 5 const int N=10; 6 7 void BubbleSort(int arr[], int n) 8 { 9 int i, j, t;10 for(i=0;iarr[j+1])15 {16 t=arr[j+1];17 arr[j+1]=arr[j];18 arr[j]=t;19 }20 }21... 阅读全文
posted @ 2013-06-07 20:07 Geekers 阅读(194) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 #define N 10 5 int main() 6 { 7 int a[N], i, j, temp, b; 8 srand(time(NULL)); 9 for(i=0;ia[j])20 temp=j;21 }22 if(i!=temp)23 {24 b=a[temp];25 a[temp]=a[i];26 a[i]=b;27 ... 阅读全文
posted @ 2013-06-07 19:07 Geekers 阅读(160) 评论(0) 推荐(0) 编辑