天大复试机试练习_001

acm.tju.edu.cn原题

This is the first problem for test.

Since all we know the ASCII code, your job is simple: Input numbers and output corresponding messages.

Input

The input will contain a list of positive integers separated by whitespaces(spaces, newlines, TABs).
Please process to the end of file (EOF).
The integers will be no less than 32.

Output

Output the corresponding message.
Note there is NOT a newline character in the end of output.

Sample Input

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

Sample Output

Hello, world!

参考答案

#include <stdio.h>
using namespace std;

int main()
{
    int a[100], i = 0;
    while ((scanf_s("%d", &a[i])) != EOF) {
        i++;
    }
    for (int j = 0; j < i; j++) {
        printf("%c", a[j]);
    }
    return 0;
}

 

 
posted @ 2020-03-11 22:30  skye_0207  阅读(229)  评论(0编辑  收藏  举报