Advertisement
Guest User

Untitled

a guest
Jan 21st, 2020
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.53 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Zad_4
  4. {
  5.     class Program
  6.     {
  7.  
  8.         static ulong B4(ulong n)
  9.         {
  10.  
  11.             ulong mask = 7;
  12.             mask <<= 6;
  13.             ulong x = mask & n;
  14.  
  15.             if (x == 0)
  16.                 x = 7;
  17.             else
  18.                 x -= 1;
  19.  
  20.             x <<= 6;
  21.             mask = ~mask;
  22.             n = n & mask;
  23.             n = n | x;
  24.  
  25.             return x;
  26.  
  27.         }
  28.         static void Main(string[] args)
  29.         {
  30.             Console.WriteLine(B4(938));
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement