페이지

2703번: Cryptoquote

https://www.acmicpc.net/problem/2703


$O(tL)$

#include<cstdio>
int t;
char s[99], key[27];
int main() {
    for (scanf("%d", &t); t--;) {
        scanf(" %[^\n]%s", s, key);
        for (int i = 0; s[i]; i++) if (s[i] ^ 32) s[i] = key[s[i] - 'A'];
        puts(s);
    }
    return 0;
}

댓글 없음 :

댓글 쓰기