【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;
}
posted @ 2018-08-17 08:43  路明天  阅读(794)  评论(0编辑  收藏  举报