Glenpl

Untitled

Oct 5th, 2014
333
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.59 KB | None | 0 0
  1. #include <iostream>
  2. #include <conio.h>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     char literki[1000];
  9.     cout << "Podaj napis aby wyswietlic go w formie numerow z tablicy ASCII: " << endl << endl;
  10.     cin.get(literki, 1000);
  11.  
  12.     for (int i = 0; i <= 999; i++)
  13.     {
  14.         if ((int)literki[i] == 0)
  15.         {
  16.             break;
  17.         }
  18.         else if ((int)literki[i] == 32)
  19.         {
  20.             cout << endl;
  21.         }
  22.         else
  23.         {
  24.             cout << endl << literki[i] << " = " << (int)literki[i];
  25.         }
  26.    }
  27.     cout << endl;
  28.     _getch();
  29.     return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment