摘要: /* ID:chenjiong PROG:sort3 LANG:C++*/#include <stdio.h>#include <string.h>const int MAXN = 1005;int N;int a[MAXN];int p1,p2,p3;int cnt;void swap(int& a,int& b){ a = a + b; b = a - b; a = a - b;}void init(){ scanf("%d",&N); p1 = p2 = p3 = cnt = 0; int i; for ( i = 0; 阅读全文
posted @ 2012-10-30 14:29 Sinker 阅读(139) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#include <string.h>#include <stdlib.h>#include <time.h>const int MAXN = 10000;int N;int a[MAXN];int K;int partition(int l,int r){ int key = a[l]; while ( l < r ) { while ( l < r && a[r] >= key ) r--; a[l] = a[r]; while ( l < r && 阅读全文
posted @ 2012-10-30 13:44 Sinker 阅读(188) 评论(0) 推荐(0) 编辑