【PAT】B1076 Wifi密码(15 分)

注意接收字符时缓冲区的换行要接受掉

#include<stdio.h>

int main()
{
    int n;
    scanf("%d", &n);
    n *= 4;

    while(n--) {
        char topics, ans;
        scanf(" %c-%c", &topics, &ans);
        if (ans == 'T')
            printf("%d", topics - 'A' + 1);
    }
    return 0;
}
全部评论

相关推荐

用微笑面对困难:只要你保证项目和获奖都是真的就行尤其是“对战,总负责人”啊这些套职,基本上队员,打杂的都这么写
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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