了解到没有加换行符,但是为什么这样输出会出错,是因为输出内容太长了吗

P1000 超级玛丽游戏

如果您是说编译错误的话,printf里的内容不能换行。
by Immortal_CODE @ 2022-12-23 10:47:24


@[QianshengYe](/user/916861) printf 不能直接换行分开 试一试在 printf 中每行行末加上一个反斜杠 ( \\ )
by 6k823 @ 2022-12-23 10:48:56


python可以 用长字符串 但是c++没有
by co7ahang @ 2022-12-23 10:49:14


```c #include<stdio.h> int main() { printf( " ********\n" " ************\n" " ####....#.\n" " #..###.....##....\n" " ###.......###### ### ###\n" " ........... #...# #...#\n" " ##*####### #.#.# #.#.#\n" " ####*******###### #.#.# #.#.#\n" " ...#***.****.*###.... #...# #...#\n" " ....**********##..... ### ###\n" " ....**** *****....\n" " #### ####\n" " ###### ######\n" "##############################################################\n" "#...#......#.##...#......#.##...#......#.##------------------#\n" "###########################################------------------#\n" "#..#....#....##..#....#....##..#....#....#####################\n" "########################################## #----------#\n" "#.....#......##.....#......##.....#......# #----------#\n" "########################################## #----------#\n" "#.#..#....#..##.#..#....#..##.#..#....#..# #----------#\n" "########################################## ############\n" ); return 0; } ```
by co7ahang @ 2022-12-23 10:56:17


@[Immortal_CODE](/user/916340) 原来如此,多谢大神
by QianshengYe @ 2022-12-26 16:59:52


@[co7ahang](/user/831011) 长知识了,多谢多谢
by QianshengYe @ 2022-12-26 17:02:22


@[QiMi](/user/528540) 好滴,多谢啦
by QianshengYe @ 2022-12-26 17:03:23


@[co7ahang](/user/831011) 多谢多谢
by QianshengYe @ 2022-12-26 17:03:52


有Dev-C++的话用万能头更好 ```cpp #include <bits/stdc++.h> ``` 还有增强输入输出的三句话最好也加上备用 ```cpp ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); ```
by Huchenxi123 @ 2023-01-06 18:35:28


@[QianshengYe](/user/916861) 你每行都得有引号
by BEST_CAT @ 2023-01-12 17:00:48


| 下一页