반응형
#include <iostream>
#include <string>
using namespace std;
int main() {
string w;
string com = "aiyeou";
string com1 = "AIYEOU";
string a = "bkxznhdcwgpvjqtsrlmf";
string b = "BKXZNHDCWGPVJQTSRLMF";
while (getline(cin, w))
{
for (int i = 0; i < w.size(); i++)
{
if (w[i] == 'a' || w[i] == 'i' || w[i] == 'y' || w[i] == 'e' || w[i] == 'o' || w[i] == 'u' || w[i] == 'A' || w[i] == 'I' || w[i] == 'Y' || w[i] == 'E' || w[i] == 'O' || w[i] == 'U')
{
for (int j = 0; j < 6; j++)
{
if (w[i] == com[j])
{
if (j >= 3)
printf("%c", com[j - 3]);
else
printf("%c", com[j + 3]);
}
else if (w[i] == com1[j])
{
if (j >= 3)
printf("%c", com1[j - 3]);
else
printf("%c", com1[j + 3]);
}
}
continue;
}
else if (isalpha(w[i]) && w[i] != 'a' && w[i] != 'i' && w[i] != 'y' && w[i] != 'e' && w[i] != 'o' && w[i] != 'u' && w[i] != 'A' && w[i] != 'I' && w[i] != 'Y' && w[i] != 'E' && w[i] != 'O' && w[i] != 'U')
{
for (int p = 0; p < a.size(); p++)
{
if (w[i] == a[p])
{
if (p >= 10)
printf("%c", a[p - 10]);
else
printf("%c", a[p + a.size() - 10]);
}
else if (w[i] == b[p])
{
if (p >= 10)
printf("%c", b[p - 10]);
else
printf("%c", b[p + b.size() - 10]);
}
}
}
else
printf("%c", w[i]);
}
cout << '\n';
}
}
'Algorithm' 카테고리의 다른 글
C++(씨쁠쁠)(cplusplus)-백준(baekjoon)(BaekJoon)코딩 3009번:네번째 점 답 (0) | 2016.12.10 |
---|---|
C++(씨쁠쁠)(cplusplus)-백준(baekjoon)(BaekJoon)코딩 1676번:팩토리얼 0의 개수답 (0) | 2016.12.10 |
C++(씨쁠쁠)(cplusplus)-백준(baekjoon)(BaekJoon)코딩 5598번:카이사르 암호 답 (0) | 2016.12.10 |
C++(씨쁠쁠)(cplusplus)-백준(baekjoon)(BaekJoon)코딩 1476번:날짜 계산 답 (0) | 2016.12.09 |
C++(씨쁠쁠)(cplusplus)-백준(baekjoon)(BaekJoon)코딩 1037번:약수 답 (0) | 2016.12.07 |