作业帮 > 综合 > 作业

/n和/t的用途?最好有实际举例

来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/12 05:21:25
/n和/t的用途?最好有实际举例
没有/n、/t什么的.
是\n和\t
\n表示换行(回车).
\t表示一个Tab字符(制表符).
比如在 printf("Hello, world!hehe"); 一句中,加上\n和\t的效果:
printf("Hello, world!hehe");
输出:
Hello, world!hehe
printf("Hello, world!\nhehe");
输出:
Hello, world!
hehe
printf("Hello, world!\thehe");
输出:
Hello, world! hehe