hdu 3079水题

水到什么都不想说了。

/*
 * hdu3079/win.cpp
 * Created on: 2012-11-4
 * Author    : ben
 */
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <queue>
#include <set>
#include <map>
#include <stack>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <functional>
#include <numeric>
#include <cctype>
using namespace std;
map<char, char> mymap;
void init() {
    char vowels[] = "aoeiu";
    char vowels2[] = "AOEIU";
    char consonant[] = "bcdfghjklmnpqrstvwxyz";
    char consonant2[] = "BCDFGHJKLMNPQRSTVWXYZ";
    for(int i = 0; i < 5; i++) {
        mymap[vowels[i]] = vowels2[i];
        mymap[vowels2[i]] = vowels2[i];
    }
    for(int i = 0; i < 21; i++) {
        mymap[consonant2[i]] = consonant[i];
        mymap[consonant[i]] = consonant[i];
    }
}
int main() {
#ifndef ONLINE_JUDGE
    freopen("data.in", "r", stdin);
#endif
    int T, len;
    char str[200];
    init();
    scanf("%d", &T);
    getchar();
    while(T--) {
        gets(str);
        len = strlen(str);
        for(int i = 0; i < len; i++) {
            str[i] = mymap[str[i]];
        }
        puts(str);
    }
    return 0;
}
posted @ 2012-11-04 17:25  moonbay  阅读(128)  评论(0编辑  收藏  举报