如果我从打印语句中删除字符串或字符,它将成功打印其余参数。如果包括在内,为什么它不起作用?
int main(void) {
int userInt;
double userDouble;
char userChar;
char userString[50];
// FIXME: Define char and string variables similarly
printf("Enter integer:\n");
scanf("%d", &userInt);
printf("Enter double:\n");
scanf("%lf", &userDouble);
printf("Enter character:\n");
scanf("%c",userChar);
printf("Enter string:\n");
scanf("%s",userString);
printf("%d %f %c %s",userInt, userDouble, userChar, userString);
printf("%c",userChar);
return 0;
}