Advertisement
IISergeyII

Untitled

Oct 21st, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.97 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int pixels[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.     int alphabet[256];
  10.     for (int i = 0; i < 256; ++i) {
  11.         alphabet[i] = 0;
  12.     }
  13.  
  14.     for (int i = 0; i < 128; ++i) {
  15.         alphabet[ pixels[i] ]++;
  16.     }
  17.  
  18.     for (int i = 0; i < 256; ++i) {
  19.         if (alphabet[i] != 0) {
  20.             cout << i << " - " << alphabet[i] << "\n";
  21.         }
  22.     }
  23.  
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement