Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma hdrstop
- #pragma argsused
- #ifdef _WIN32
- #include <tchar.h>
- #else
- typedef char _TCHAR;
- #define _tmain main
- #endif
- #include <stdio.h>
- #include <iostream>
- #include <conio.h>
- #include <string>
- using namespace std;
- string ReplaceString(string subject, const string& search, const string& replace) {
- size_t pos = 0;
- while ((pos = subject.find(search, pos)) != std::string::npos) {
- subject.replace(pos, search.length(), replace);
- pos += replace.length();
- }
- return subject;
- }
- int _tmain(int argc, _TCHAR* argv[])
- {
- string str;
- getline(cin,str);
- string ToReplaces[2][58]={{"ce","ci","cy","Ce","Ci","Cy","C","c","qu","Qu","q","Q","x","X","w","W","ph","Ph","you","You","oo","Oo","ee","Ee","th","Th","rr","Rr","tt","Tt","Pp","pp","ss","Ss","Dd","dd","ff","Ff","Gg","gg","Hh","hh","jj","Jj","kk","Kk","ll","Ll","zz","Zz","Vv","vv","Bb","bb","Nn","nn","mm","Mm"},
- {"se","si","sy","Se","Si","Sy","K","k","kv","Kv","k","K","ks","Ks","v","V","f","F","u","U","u","U","i","I","z","Z","r","R","t","T","P","p","s","S","D","d","f","F","G","g","H","h","j","J","k","K","l","L","z","Z","V","v","B","b","N","n","m","M" } };
- for (int i = 0; i < 58; i++)
- {
- str=ReplaceString(str, ToReplaces[0][i],ToReplaces[1][i]);
- }
- cout << str;
- getch();
- return 0;
- }
Add Comment
Please, Sign In to add comment