Advertisement
Guest User

Untitled

a guest
Mar 25th, 2016
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. int Find_N_Number(unsigned int value)
  2. {
  3.     int MaxRange = 129;
  4.     int MinRange = 97;
  5.     int StartNumber = 0;
  6.     bool inRange = false;
  7.     unsigned int result, test;
  8.  
  9.     do
  10.     {
  11.         test = value + StartNumber * 33;
  12.         if (test >= MinRange && test <= MaxRange)
  13.         {
  14.             inRange = true;
  15.             result = StartNumber;
  16.         }
  17.         else {
  18.             ++StartNumber;
  19.         }
  20.  
  21.  
  22.     } while (inRange == false);
  23.  
  24.     return result;
  25. }  
  26. ////// the test code.
  27. unsigned int value = 2520255578;
  28. value -= 0x1505;
  29.    
  30. unsigned int ch, n;
  31. char resultStr[100] = "";
  32. int i = 0;
  33. do
  34. {
  35.     ch = value % 33;
  36.     n = Find_N_Number(ch);
  37.     ch = ch + (n * 33);
  38.     resultStr[i] = ch;
  39.     ++i;
  40.     value = (value - ch) / 33;
  41. } while (value > 0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement