换行符是\n
1、为什么不能运行,scanf里%c的数量跟参数数量对不上;
2、这题用循环做,scanf会自动跳过空白,读入失败会返回零,注意,示例是示例,其他测试用例的格式可不一定一样
int main()
{
int ch;
while (scanf_s("%d",&ch))
printf("%c", ch);
return 0;
}
供参考:
#include <stdio.h>
int main()
{
char str[256];
int i = 0;
while (scanf("%d",&str[i++]) != EOF && i < 255);
str[i] = '\0';
printf("%s", str);
return 0;
}