1043 输出PATest (20 分)
#include<string.h>
int main()
{
int P=0,A=0,T=0,e=0,s=0,t=0;
char ch;
while((ch=getchar())!='\n')
{
if(ch=='P')P++;
else if(ch=='A')A++;
else if(ch=='T')T++;
else if(ch=='e')e++;
else if(ch=='s')s++;
else if(ch=='t')t++;
else continue;
}
while(P!=0||A!=0||T!=0||e!=0||s!=0||t!=0)
{
if(P){ printf("P");P--;}
if(A){ printf("A");A--;}
if(T){ printf("T");T--;}
if(e){ printf("e");e--;}
if(s){ printf("s");s--;}
if(t){ printf("t");t--;}
}
}