【PAT】B1043 输出PATest(20 分)

/*
    
*/
#include<stdio.h>
#include<algorithm>
#include<string.h>
#include<ctype.h>
using namespace std;
int main(){
    char temp;
    int P,A,T,e,s,t;
    P=A=T=e=s=t=0;
    while(scanf("%c",&temp)!=EOF){
        switch(temp){
        case 'P': P++;
            break;
        case 'A': A++;
            break;
        case 'T': T++;
            break;
        case 'e': e++;
            break;
        case 's': s++;
            break;
        case 't': t++;
            break;
        }
    }
    while(P!=0||A!=0||T!=0||e!=0||s!=0||t!=0){
        if(P!=0){
            printf("P");
            P--;
        }
        if(A!=0){
            printf("A");
            A--;
        }
        if(T!=0){
            printf("T");
            T--;
        }
        if(e!=0){
            printf("e");
            e--;
        }
        if(s!=0){
            printf("s");
            s--;
        }
        if(t!=0){
            printf("t");
            t--;
        }
    }
    return  0;
}
全部评论

相关推荐

2025-11-24 14:22
安徽师范大学 财务
勇敢求职牛牛:然后简历的话,我个人意见(双非本有零星的垃圾offer),学校经历太多了,写了也应该往财务方面靠,然后技能方面多写一点吧,比如ERP的水平,对某些行业的流程(制造业),对数据的逻辑和敏感之类的
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务