Advertisement
RuiViana

AA_Compara digitos

Jun 18th, 2018
302
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1.   int KHex = K + (6 * (K / 0x0A));
  2.   int MHex = M + (6 * (M / 0x0A));
  3.   int KH = KHex >> 4;
  4.   int KL = KHex & 0x000F;
  5.   int MH = MHex >> 4;
  6.   int ML = MHex & 0x000F;
  7.  
  8.   if (K == M) X = 10;
  9.   if (K != M )
  10.   {
  11.     if ((KH == ML) && (KL == MH))  X = 9;
  12.     else if ((KH == MH) || (KL == ML) || (KH == ML) || (KL == MH) )  X = 8;
  13.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement