在函数printf的末尾转义字符“\n”作用是换行,为何当printf提示用户输入的信息时很少用该字符?

来源:百度知道 编辑:UC知道 时间:2024/05/29 00:27:21
这是有关C语言程序的问题
我是说,printf他会提醒你要输入一些东西,比如说: 请输入 printf(“i=%d,sjdabdhdjskl”); 但是一般来讲在编程时完整输入应为: printf("i=%d,hdshsalhsaj\n"); 中间是乱打的,不用管!

1、
printf("Hi,Good Guy! Please Input Your Age..\n");

这时候屏幕上应该显示的是:

Hi,Good Guy! Please Input Your Age..
|←(光标坐在位置。)
2、
printf("Hi,Good Guy! Please Input Your Age..");

这时候屏幕上应该显示的是:

Hi,Good Guy! Please Input Your Age.. |←(光标坐在位置。)

\n我知道,输入的信息貌似因该用scanf吧,但你问的问题有点模糊!请明示!楼主