Advertisement
poczatkujacykoder

Untitled

Oct 26th, 2014
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.49 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5. typedef struct BIT
  6. {
  7.     bool bit[8];
  8.     bool klucz[10];
  9.  
  10.     unsigned char klucz[0]: 1;
  11.    
  12.  
  13.     void zamiana(unsigned char c)
  14.     {
  15.         bit[0] = (c >> 7) % 2;
  16.         bit[1] = (c >> 6) % 2;
  17.         bit[2] = (c >> 5) % 2;
  18.         bit[3] = (c >> 4) % 2;
  19.         bit[4] = (c >> 3) % 2;
  20.         bit[5] = (c >> 2) % 2;
  21.         bit[6] = (c >> 1) % 2;
  22.         bit[7] = c % 2;
  23.     }
  24.  
  25.  
  26. }text;
  27. int main()
  28. {
  29.     unsigned char tekst;
  30.     cin >> tekst;
  31.     zamiana(tekst);
  32.  
  33.  
  34.  
  35.     system("pause");
  36.     return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement