早教吧 育儿知识 作业答案 考试题库 百科 知识分享

超简单的C++小题DescriptionThisisthefirstproblemfortest.SinceallweknowtheASCIIcode,yourjobissimple:Inputnumbersandoutputcorrespondingmessages.InputTheinputwillcontainalistofpositiveintegersseparatedbywhitespaces(sp

题目详情
超简单的C++小题
Description
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.
▼优质解答
答案和解析
#include
int main()
{
\x05char s[1001] ;
\x05int x ,i ;
\x05i = 0 ;
\x05while( scanf("%d",&x ) )
\x05{
\x05\x05s[i++] = x ;
\x05}
\x05s[i] = '\0' ;
\x05printf("%s",s ) ;
\x05return 0 ;
}