#include
int main(void)
{
char ch;
printf("Please enter a character.\n");
scanf("%c",&ch);
printf("The code for %c is %d.\n",ch,ch);
return 0;
}
为什么我输入字符时,按回车,屏幕并没有出现打印的字符串,光标移到下一行的开头?
#include
int main(void)
{
char ch;
printf("Please enter a character.\n");
scanf("%c",&ch);
printf("The code for %c is %d.\n",ch,ch);
return 0;
}
为什么我输入字符时,按回车,屏幕并没有出现打印的字符串,光标移到下一行的开头?
char ch;
printf("Please enter a character.\n");
ch = getchar();
printf("The code for %c is %d.\n", ch, ch);
return 0;