fork(1) download
  1. #include <iostream>
  2. #include <cstring>
  3. using namespace std;
  4.  
  5. const int MAX_LENGTH = 2000;
  6.  
  7. int main() {
  8. char array[2000];
  9. char index [25] = "abcdefghijklzyxwvutsrqop"; // 24 marimea;
  10. for (int i = 0; i < 24; ++i) {
  11. //cout << index[i]<< " " << i<<"\n";
  12. }
  13.  
  14. while (cin.getline(array, MAX_LENGTH)) {
  15. int length = strlen(array);
  16. for (int i = 0; i < length; ++i) {
  17. array[i] = tolower(array[i]);
  18. }
  19. // cout << "|"<< i <<"|\n";
  20. for (int i = 0; i < length; ++i) {
  21. int flag = 1;
  22. char aux ;
  23. if (array[i] == 'a') {
  24. cout << "1";
  25. flag = 0;
  26. }else if (array[i] == 'e') {
  27. cout << "2";
  28. flag = 0;
  29. } else if (array[i] == 'i') {
  30. cout << "3";
  31. flag = 0;
  32. } else if (array[i] == 'o') {
  33. cout << "4";
  34. flag = 0;
  35. } else if (array[i] == 'u') {
  36. cout << 5;
  37. flag = 0;
  38. }
  39. //if ((array[i] >= 'a' && array[i] <= 'l')) {
  40.  
  41. if (flag == 1) {
  42. aux = array[i] ;
  43. if (array[i] >= 'a' && array[i] <= 'l') {
  44. for (int i = 0; i < 24; ++i) {
  45. if (aux == index[i]) {
  46. aux = index[i + 12];
  47. cout << aux << "";
  48. }
  49. }
  50. } else if (array[i] >= 'o' && array[i] <= 'z') {
  51. for (int i = 0; i < 24; ++i) {
  52. if (aux == index[i]) {
  53. aux = index[i - 12];
  54. cout << aux << "";
  55. }
  56. }
  57. } else if (array[i] == 'm') {
  58. aux = 'n';
  59. cout << aux << "";
  60. }else if (array[i] == 'n') {
  61. aux = 'm';
  62. cout << aux << "";
  63. }
  64.  
  65. // cout << aux;
  66. }
  67. //}
  68. }
  69. //cout << length <<" ";
  70. }
  71.  
  72. return 0;
  73. }
  74.  
Success #stdin #stdout 0.01s 5320KB
stdin
Gogonelele! Sunt bUune
stdout
t4t4m2po2po2h5mgy�55m2