Hello, world!

Hello, world!

时间: 1ms        内存:64M

描述:

This is the first problem for test.

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

输入:

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 the corresponding message.
Note there is NOT a newline character in the end of output.

示例输入:

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

示例输出:

Hello, world!

提示:

参考答案(内存最优[1092]):

#include<stdio.h>
int main()
{
int a;
char ch;
while(scanf("%d",&a)!=EOF)
{
ch=a;
printf("%c",ch);
}
return 0;
}

参考答案(时间最优[0]):

#include<stdio.h>
void main()
{
   int a;char b;
   while(scanf("%d",&a)!=EOF){
       b=a;
       printf("%c",b);
   }
}

题目和答案均来自于互联网,仅供参考,如有问题请联系管理员修改或删除。

点赞

发表评论

电子邮件地址不会被公开。必填项已用 * 标注