1. C++ / Говнокод #5899

    +171

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    57. 57
    58. 58
    59. 59
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    66. 66
    67. 67
    68. 68
    69. 69
    70. 70
    71. 71
    72. 72
    73. 73
    74. 74
    75. 75
    void Cryptogram(const vector<string> &vector1, vector<string> &vector2)
    {
      string word;
      char new_letter;
      long i, j, wordSize, vecSize, vecSize2;
      vecSize = vector1.size();
      for(j=0; j<vecSize; j++)
        {
          word = vector1[j];
          //cout<<word<<endl;
          wordSize = word.size();
          cout<<wordSize<<endl;
          for(i=0; i<wordSize; i++)
      {
        new_letter = word[i];
        cout<<"& " << new_letter<< " " << isalpha(new_letter) << endl;
        if(isalpha(new_letter)==true)
          {
            if(isupper(new_letter)==true)
        {
    
          if (new_letter == 'A')
            new_letter = 'W';
          else if(new_letter == 'B')
            new_letter = 'Y';
          else if(new_letter == 'C')
            new_letter = 'I';
          else if(new_letter == 'D')
            new_letter = 'J';
          else if(new_letter == 'E')
            new_letter = 'K';
          else if(new_letter == 'F')
            new_letter = 'C';
          else if(new_letter == 'G')
            new_letter = 'U';
          else if(new_letter == 'H')
            new_letter = 'V';
          else if(new_letter == 'I')
            new_letter = 'D';
          else if(new_letter == 'J')
            new_letter = 'P';
          else if(new_letter == 'K')
            new_letter = 'Q';
          else if(new_letter == 'L')
            new_letter = 'L';
          else if(new_letter == 'M')
            new_letter = 'Z';
          else if(new_letter == 'N')
            new_letter = 'H';
          else if(new_letter == 'O')
    
            new_letter = 'T';
          else if(new_letter == 'P')
            new_letter = 'G';
          else if(new_letter == 'Q')
            new_letter = 'A';
          else if(new_letter == 'R')
            new_letter = 'B';
          else if(new_letter == 'S')
            new_letter = 'M';
          else if(new_letter == 'T')
            new_letter = 'X';
          else if(new_letter == 'U')
            new_letter = 'E';
          else if(new_letter == 'V')
            new_letter = 'F';
          else if(new_letter == 'W')
            new_letter = 'O';
          else if(new_letter == 'X')
            new_letter = 'N';
          else if(new_letter == 'Y')
            new_letter = 'R';
          else if(new_letter == 'Z')
            new_letter = 'S';
        }

    Cryptogram function, it's much longer, with 26 if statements if the letter is lowercase.

    Запостил: BigEndian, 06 Марта 2011

    Комментарии (8) RSS

    Добавить комментарий