Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<string>
- #include<cstdio>
- using namespace std;
- string EX;
- bool fl(int i){
- return EX[i] != 'A' && EX[i] != 'E' && EX[i] != 'I' && EX[i] != 'U' && EX[i] != 'O' && EX[i] != 'H' && EX[i] != 'W' && EX[i] != 'Y';
- }
- int S[3000];
- int main(){
- S['B'] = 1;
- S['F'] = 1;
- S['P'] = 1;
- S['V'] = 1;
- S['C'] = 2;
- S['G'] = 2;
- S['J'] = 2;
- S['K'] = 2;
- S['Q'] = 2;
- S['S'] = 2;
- S['X'] = 2;
- S['Z'] = 2;
- S['D'] = 3;
- S['T'] = 3;
- S['L'] = 4;
- S['M'] = 5;
- S['N'] = 5;
- S['R'] = 6;
- while (getline(cin,EX))
- {
- EX=" "+EX;
- for (int i = 1; i<(int)EX.size(); i++)
- {
- if (fl(i))
- {
- if (S[(int)EX[i]] != S[(int)EX[i - 1]]||!fl(i-1))cout << S[(int)EX[i]];
- }
- }
- cout << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment