#include <stdio.h>
int main()
{
char a[10001]={0},b[10001]={0},c[10001]={0};
int i=0,j=0,x=0,z=0;
scanf("%s",a);
while(a[i])
{
if(a[i]=='P' || a[i]=='A' || a[i]=='T' || a[i]=='e'|| a[i]=='s' || a[i]=='t')
{b[j] = a[i]; j++;}
i++;
}
x=j-1;
while(x!=(-1))
{
i=0;
while(i<=x)
{
if(b[i]=='P')
{c[z] = b[i];z++;b[i]=b[x];x--;break;}
i++;
}
i=0;
while(i<=x)
{
if(b[i]=='A')
{c[z] = b[i];z++;b[i]=b[x];x--;break;}
i++;
}
i=0;
while(i<=x)
{
if(b[i]=='T')
{c[z] = b[i];z++;b[i]=b[x];x--;break;}
i++;
}
i=0;
while(i<=x)
{
if(b[i]=='e')
{c[z] = b[i];z++;b[i]=b[x];x--;break;}
i++;
}
i=0;
while(i<=x)
{
if(b[i]=='s')
{c[z] = b[i];z++;b[i]=b[x];x--;break;}
i++;
}
i=0;
while(i<=x)
{
if(b[i]=='t')
{c[z] = b[i];z++;b[i]=b[x];x--;break;}
i++;
}
}
printf("%s",c);
return 0;
}
1043 输出PATest,C
最新推荐文章于 2023-06-27 12:29:15 发布