Advertisement
Guest User

Untitled

a guest
Apr 25th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5.  
  6.  
  7. void print(string str) {
  8.  
  9.  
  10. string original = str;
  11.  
  12. for (int i = 0; i < str.length(); i++) {
  13.  
  14. if (str[i] == 'A' || str[i] == 'a') {
  15. str[i] = '4';
  16. }
  17.  
  18. }
  19.  
  20. for (int i = 0; i < str.length; i++) {
  21.  
  22. if (str[i] == 'B' || str[i] == 'b') {
  23. str[i] = '6';
  24. }
  25. }
  26.  
  27. for (int i = 0; i < str.length; i++) {
  28.  
  29. if (str[i] == 'N' || str[i] == 'n') {
  30.  
  31. string n = "(\)";
  32. const char *cstr = n.c_str();
  33. str[i] = *cstr;
  34. }
  35. }
  36.  
  37. for (int i = 0; i < str.length; i++) {
  38. if (str[i] == 'E' || str[i] == 'e') {
  39. str[i] = '3';
  40. }
  41. }
  42.  
  43. for (int i = 0; i < str.length; i++) {
  44. if (str[i] == 'I' || str[i] == 'i') {
  45. str[i] = '1';
  46. }
  47. }
  48.  
  49. for (int i = 0; i < str.length; i++) {
  50. if (str[i] == 'L' || str[i] == 'l') {
  51. str[i] = '1';
  52. }
  53. }
  54.  
  55. for (int i = 0; i < str.length; i++) {
  56. if (str[i] == 'M' || str[i] == 'm') {
  57. str[i] = '(V)';
  58. }
  59. }
  60.  
  61. for (int i = 0; i < str.length; i++) {
  62. if (str[i] == 'O' || str[i] == 'o') {
  63. str[i] = '0';
  64. }
  65. }
  66.  
  67. for (int i = 0; i < str.length; i++) {
  68. if (str[i] == 'S' || str[i] == 's') {
  69. str[i] = '5';
  70. }
  71. }
  72.  
  73. for (int i = 0; i < str.length; i++) {
  74. if (str[i] == 'T' || str[i] == 't') {
  75. str[i] = '7';
  76. }
  77. }
  78.  
  79. for (int i = 0; i < str.length; i++) {
  80. if (str[i] == 'V' || str[i] == 'v') {
  81. str[i] = '(\/)';
  82. }
  83. }
  84.  
  85. for (int i = 0; i < str.length; i++) {
  86. if (str[i] == 'W' || str[i] == 'w') {
  87. str[i] = '`//';
  88. }
  89. }
  90.  
  91. cout << original << "-> " << str << endl;
  92. }
  93.  
  94.  
  95. int main() {
  96.  
  97. string str;
  98. while (true)
  99. {
  100. cout << "Write here: ";
  101. getline(cin, str);
  102.  
  103. print(str);
  104. }
  105.  
  106. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement