Untitled

mail@pastecode.io avatar
unknown
c_cpp
a month ago
642 B
1
Indexable
Never
#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;
}
Leave a Comment