的时候,不包括%d和%C规范之间的空白在scanf函数的在下面的程序格式字符串,并在运行时间期间为"4小时"给输入,则输出是"整数= 4和字符= .
在这种情况下,变量"c"如何获取输入,如果我在%d和%c规范之间包含空格,它会有什么不同?
#include <stdio.h>
int main()
{
char c;
int i;
printf("Enter an Integer and a character:\n");
scanf("%d %c",&i,&c);
printf("Integer = %d and Character = %c\n",i,c);
getch();
}
Run Code Online (Sandbox Code Playgroud)