1043 输出PATest
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/f172b35ddd62c1b73183a3488d0d046e.png)
#include<stdio.h>
#include<iostream>
#include<map>
#include<vector>
#include<string>
using namespace std;
map<char, int> mp;
int main(void) {
string s; getline(cin, s);
for (int i = 0; i < s.size(); i++) { mp[s[i]]++; }
while (mp['P'] || mp['A'] || mp['T'] || mp['e'] || mp['s'] || mp['t']) {
if (mp['P']) {
cout << 'P'; mp['P']--;
}
if (mp['A']) {
cout << 'A'; mp['A']--;
}
if (mp['T']) {
cout << 'T'; mp['T']--;
}
if (mp['e']) {
cout << 'e'; mp['e']--;
}
if (mp['s']) {
cout << 's'; mp['s']--;
}
if (mp['t']) {
cout << 't'; mp['t']--;
}
}
return 0;
}