Advertisement
IISergeyII

Untitled

Oct 21st, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.39 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int p[128] = {20, 20, 80, 140, 140, 160, 160, 160, 180, 180, 180, 180, 180, 180, 160, 160, 140, 80, 40, 0, 0, 0, 0, 0, 0, 20, 60, 60, 120, 120, 140, 120, 140, 120, 120, 120, 120, 80, 80, 100, 80, 60, 80, 80, 120, 120, 100, 80, 80, 80, 100, 100, 80, 80, 120, 80, 60, 60, 40, 20, 20, 20, 40, 120, 180, 200, 220, 220, 220, 220, 220, 240, 240, 220, 220, 220, 220, 200, 200, 180, 200, 200, 200, 200, 200, 220, 200, 200, 160, 160, 120, 80, 0, 0, 0, 0, 0, 20, 80, 100, 60, 60, 20, 0, 0, 0, 0, 0, 0, 40, 40, 40, 60, 80, 80, 80, 80, 80, 120, 100, 100, 80, 100, 100, 80, 120, 60, 80};
  8.  
  9.     for (int i = 0; i < 128; ++i) {
  10.         if ( p[i] == 240 )
  11.             cout << "0000";
  12.         if ( p[i] == 140 )
  13.             cout << "0001";
  14.         if (p[i] == 40)
  15.             cout << "0010";
  16.         if (p[i] == 160)
  17.             cout << "0011";
  18.         if (p[i] == 20)
  19.             cout << "0100";
  20.         if (p[i] == 180)
  21.             cout << "0101";
  22.         if (p[i] == 60)
  23.             cout << "0110";
  24.         if (p[i] == 100)
  25.             cout << "0111";
  26.         if (p[i] == 200)
  27.             cout << "1000";
  28.         if (p[i] == 220)
  29.             cout << "1001";
  30.         if (p[i] == 120)
  31.             cout << "1010";
  32.         if (p[i] == 0)
  33.             cout << "1011";
  34.         if (p[i] == 80)
  35.             cout << "1100";
  36.     }
  37.  
  38.  
  39.     return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement