#include<iostream>
#include<string>
using namespace std;
int main()
{
int ch[255]={0};
char temp=0,flag=1;
while((temp = getchar())!='\n')
{
if(temp=='P'||temp=='A'||temp=='T'||temp=='e'||temp=='s'||temp=='t')
ch[temp] += 1;
}
while(flag)
{
if(ch['P']!=0)
{
printf("%c",'P');
ch['P']--;
}
if(ch['A']!=0)
{
printf("%c",'A');
ch['A']--;
}
if(ch['T']!=0)
{
printf("%c",'T');
ch['T']--;
}
if(ch['e']!=0)
{
printf("%c",'e');
ch['e']--;
}
if(ch['s']!=0)
{
printf("%c",'s');
ch['s']--;
}
if(ch['t']!=0)
{
printf("%c",'t');
ch['t']--;
}
flag = ch['P']||ch['A']||ch['T']||ch['e']||ch['s']||ch['t'];
}
return 0;
}
1043. 输出PATest(20)
最新推荐文章于 2018-09-04 11:17:50 发布