Untitled
unknown
c_cpp
a year ago
642 B
9
Indexable
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int start, end;
cout << "Podaj poczatkowy znak ASCII (0 - 127): ";
cin >> start;
cout << "Podaj koncowy znak ASCII (0 - 127): ";
cin >> end;
if (start < 0 || start > 127)
{
start = 0;
}
if (end < 0 || end > 127)
{
end = 127;
}
cout << left << setw(10) << "ASCII" << "VALUE" << endl;
cout << "----------------" << endl;
for (int i = start; i <= end; ++i)
{
cout << left << setw(10) << static_cast<char>(i) << i << endl;
}
return 0;
}
Editor is loading...
Leave a Comment