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

    +2

    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
    76. 76
    77. 77
    78. 78
    79. 79
    80. 80
    81. 81
    82. 82
    83. 83
    84. 84
    85. 85
    86. 86
    87. 87
    88. 88
    89. 89
    90. 90
    91. 91
    92. 92
    93. 93
    94. 94
    95. 95
    96. 96
    97. 97
    98. 98
    string shifarhex(string count)
    {
    
      string take,take2;
    string getch1;
    
    
    	getch1=count;
    
        string sub1 = "0000";//2 to 3		 31
       unsigned int pos1 = getch1.find(sub1,0);
      if(pos1 != string::npos)
      {
       take2="0"; 
      }
         string sub2 = "0001";//2 to 3		 31
       unsigned int pos2 = getch1.find(sub2,0);
      if(pos2 != string::npos)
      {
       take2="1"; 
      }
       string sub3 = "0010";//2 to 3		 31
       unsigned int pos3 = getch1.find(sub3,0);
      if(pos3 != string::npos)
      {
       take2="2"; 
      }
       string sub4 = "0011";//2 to 3		 31
       unsigned int pos4 = getch1.find(sub4,0);
      if(pos4 != string::npos)
      {
       take2="3"; 
      }
       string sub5 = "0100";//2 to 3		 31
       unsigned int pos5 = getch1.find(sub5,0);
      if(pos5 != string::npos)
      {
       take2="4"; 
      }
         string sub6 = "0101";//2 to 3		 31
       unsigned int pos6 = getch1.find(sub6,0);
      if(pos6 != string::npos)
      {
       take2="5"; 
      }
          string sub7 = "0110";//2 to 3		 31
       unsigned int pos7 = getch1.find(sub7,0);
      if(pos7 != string::npos)
      {
       take2="6"; 
      }
          string sub8 = "0111";//2 to 3		 31
       unsigned int pos8 = getch1.find(sub8,0);
      if(pos8 != string::npos)
      {
       take2="7"; 
      }
        string sub9 = "1000";//2 to 3		 31
       unsigned int pos9 = getch1.find(sub9,0);
      if(pos9 != string::npos)
      {
       take2="8"; 
      }
       string sub10 = "1001";//2 to 3		 31
       unsigned int pos10 = getch1.find(sub10,0);
      if(pos10 != string::npos)
      {
       take2="9"; 
      }
    
       string sub11 = "1010";//2 to 3		 31
       unsigned int pos11 = getch1.find(sub11,0);
      if(pos11 != string::npos)
      {
       take2="A"; 
      }
        string sub12 = "1011";//2 to 3		 31
       unsigned int pos12 = getch1.find(sub12,0);
      if(pos12 != string::npos)
      {
       take2="B"; 
    
      }
       string sub13 = "1100";//2 to 3		 31
       unsigned int pos13 = getch1.find(sub13,0);
      if(pos13 != string::npos)
      {
       take2="B"; 
      }
       string sub14 = "1101";//2 to 3		 31
       unsigned int pos14 = getch1.find(sub14,0);
      if(pos14 != string::npos)
      {
       take2="D"; 
      }
        string sub15 = "1110";//2 to 3		 31
       unsigned int pos15 = getch1.find(sub15,0);
    ...

    http://www.sql.ru/forum/1269897/delaem-arhivator
    Вореционное зожатие битов

    Запостил: j123123, 21 Сентября 2017

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

    • зожатие нулей разжимание зожатых нулей
      if(g==0)
      {
        
         bytesrd="00000000";
      }
      
      else if(g==1 || g==9 || g==17 || g==25 || g==33)
      {
         bytesrd="0000000"+bin;
      }
      
      else if(g==2 || g==10 || g==18 || g==26 || g==34)
      {
         bytesrd="000000"+bin;
      }
      
      else if(g==3 || g==11 || g==19 || g==27 || g==35)
      {
         bytesrd="00000"+bin;
      }
      
      else if(g==4 || g==12 || g==20 || g==28 || g==36)
      {
         bytesrd="0000"+bin;
      }
      
      else if(g==5 || g==13 || g==21 || g==29 || g==37)
      {
          bytesrd="000"+bin;
      }
      else if(g==6 || g==14 || g==22 || g==30 || g==38)
      {
         	bytesrd="00"+bin;
      }
      else if(g==7 || g==15 || g==23 || g==31 || g==39)
      {
         	bytesrd="0"+bin;
      }
      else
      {
      	bytesrd=bin;
      }
      Ответить

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