Advertisement
HyperSensualNarwhal

ASCII table in 16 symbols per row

Dec 1st, 2016
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. /*
  2. Вывести ASCII-таблицу по 16 символов в строке.
  3. */
  4.  
  5. #include <iostream>
  6.  
  7. using std::cout;
  8. using std::cin;
  9. using std::endl;
  10.  
  11. void main()
  12. {
  13.     setlocale(LC_ALL, "Russian");
  14.  
  15.     int i = 0;
  16.     char ch = 0;
  17.  
  18.     while (i < 255) // в ASCII (Win-1251) всего 256 символов (от 0 до 255)
  19.     {
  20.         i++;
  21.         ch++;
  22.  
  23.         if ((i % 16) == 0) cout << endl;
  24.         else cout << ch << " ";
  25.     }
  26.  
  27.     cout << endl;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement