C ++ output characters according to the input ASCII value

Title description
Output corresponding characters according to the input ASCII value

Input
Input will contain a list of positive integers separated by spaces (spaces, line breaks, tabs). Please process to the end of the file (EOF). The integer is not less than 32.

Output
Output the corresponding character. Note that there is no line break at the end of the output.

Sample input
72 101 108 108 111 44
32 119 111 114 108 100 33

Sample output
Hello, world!

Implementation code

#include<iostream>
using namespace std;
int main()
{
    int a;
    while(cin>>a&&a!=EOF)cout<<(char)a;
    return 0;
}
Published 9 original articles · liked 0 · visits 253

Guess you like

Origin blog.csdn.net/bdwdwks/article/details/105405695