// : 定义控制台应用程序的入口点。
//
#include ""
#include<iostream>
#include<fstream>
using namespace std;
template<class type>
void quicksort(type a[],int p,int r)
{
if(p<r)
{
int q=partition(a,p,r);
quicksort(a,p,q-1);
quicksort(a,q+1,r);
}
}
template<class type>
int partition(type a[],int p,int r)
{
int i=p,j=r+1;
type x=a[p];
while(true)
{
while(a[++i]<x&&i<r);
while(a[--j]>x);
if(i>=j) break;
swap(a[i],a[j]);
}
a[p]=a[j];
a[j]=x;
return j;
}
int _tmain(int argc, _TCHAR* argv[])
{
int i=0,temp,sum=0;
int aa[100];
fstream ifile;
char ch;
("d:\\");//作为输入文件打开
(ch);
while(true)
{
if(()==1) break;
if(ch==
快速排序 来自淘豆网m.daumloan.com转载请标明出处.