//一个数组中存储有且仅有大写和小写字母,编写一个函数对数组内的字母重新排列,让小写字母在所有大写字母之前
#include<iostream>
using namespace std;
void Partition(char *a,int low,int high)
{
if(a==NULL||low>=high||low<0||high<0)
return;
while(low<high)
{
while(low<high&&isupper(a[high]))
--high;
while(low<high&&islower(a[low]))
++low;
char t=a[high];
a[high]=a[low];
a[low]=t;
}
}
void main()
{
char a[]={'a','A','Z','d','B','s','b','\0'};
Partition(a,0,6);
cout<<a<<endl;
}