问答详情
源自:1-5 良好习惯之规范

\n转义字符的用处

\n转义字符有什么用,输不输都一样啊

提问者:慕粉6321516 2019-06-18 12:21

个回答

  • 佛山小阿giao
    2019-06-18 13:09:05

    如果没有\n,那么输出代码便会成这样:

    ...

    printf("I love imooc.");

    printf("I can learn many things in imooc.");

    输出:I love imooc.I can learn many things in imooc.


    若加\n:

    printf("I love imooc.\n");

    printf("I can learn many things in imooc.\n");

    输出:I love imooc.

    I can learn many things in imooc.