鱼C论坛

 找回密码
 立即注册
查看: 324|回复: 1

[已解决]超级玛丽是每一个少年都玩过的经典游戏。

[复制链接]
发表于 2023-12-20 12:49:57 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
超级玛丽是每一个少年都玩过的经典游戏。请用字符画的形式输出下面的超级玛丽游戏中的一个场景。

输入格式:
无输入

输出格式:
请按样例格式输出。

输入样例:

输出样例:
                ********
               ************
               ####....#.
             #..###.....##....
             ###.......######              ###                 ###           ###           ###
                ...........               #...#               #...#         #...#         #...#
               ##*#######                 #.#.#               #.#.#         #.#.#         #.#.#
            ####*******######             #.#.#               #.#.#         #.#.#         #.#.#
           ...#***.****.*###....          #...#               #...#         #...#         #...#
           ....**********##.....           ###                 ###           ###           ###
           ....****    *****....
             ####        ####
           ######        ######
##############################################################              ##################################
#...#......#.##...#......#.##...#......#.##------------------#              #...#......#.##------------------#
###########################################------------------#              ###############------------------#
#..#....#....##..#....#....##..#....#....#####################              #..#....#....#####################
##########################################    #----------#                  ##############    #----------#
#.....#......##.....#......##.....#......#    #----------#                  #.....#......#    #----------#
##########################################    #----------#                  ##############    #----------#
#.#..#....#..##.#..#....#..##.#..#....#..#    #----------#                  #.#..#....#..#    #----------#
##########################################    ############                  ##############    ############

这题C++怎么写
最佳答案
2023-12-20 12:50:12
要输出超级玛丽游戏场景的字符画,可以使用C++语言的cout语句进行输出。利用换行符和空格来控制字符的位置,再使用特定的字符来构建整个场景。以下是一个可能的实现:
  1. #include <iostream>
  2. using namespace std;
  3. int main() {
  4.     cout << "                ********" << endl;
  5.     cout << "               ************" << endl;
  6.     cout << "               ####....#." << endl;
  7.     cout << "             #..###.....##...." << endl;
  8.     cout << "             ###.......######              ###                 ###           ###           ###" << endl;
  9.     cout << "                ...........               #...#               #...#         #...#         #...#" << endl;
  10.     cout << "               ##*#######                 #.#.#               #.#.#         #.#.#         #.#.#" << endl;
  11.     cout << "            ####*******######             #.#.#               #.#.#         #.#.#         #.#.#" << endl;
  12.     cout << "           ...#***.****.*###....          #...#               #...#         #...#         #...#" << endl;
  13.     cout << "           ....**********##.....           ###                 ###           ###           ###" << endl;
  14.     cout << "           ....****    *****...." << endl;
  15.     cout << "             ####        ####" << endl;
  16.     cout << "           ######        ######" << endl;
  17.     cout << "##############################################################              ##################################" << endl;
  18.     cout << "#...#......#.##...#......#.##...#......#.##------------------#              #...#......#.##------------------#" << endl;
  19.     cout << "###########################################------------------#              ###############------------------#" << endl;
  20.     cout << "#..#....#....##..#....#....##..#....#....#####################              #..#....#....#####################" << endl;
  21.     cout << "##########################################    #----------#                  ##############    #----------#" << endl;
  22.     cout << "#.....#......##.....#......##.....#......#    #----------#                  #.....#......#    #----------#" << endl;
  23.     cout << "##########################################    #----------#                  ##############    #----------#" << endl;
  24.     cout << "#.#..#....#..##.#..#....#..##.#..#....#..#    #----------#                  #.#..#....#..#    #----------#" << endl;
  25.     cout << "##########################################    ############                  ##############    ############" << endl;
  26.     return 0;
  27. }
复制代码

这段代码中,通过多次的cout语句按照场景的样式输出了相应的字符。每一行都以`endl`表示换行。最后返回0表示程序运行成功。

希望这个代码能够满足你的需求!

以上回复来自 FishC AI 小助理,如未能正确解答您的问题,请继续追问。
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2023-12-20 12:50:12 | 显示全部楼层    本楼为最佳答案   
要输出超级玛丽游戏场景的字符画,可以使用C++语言的cout语句进行输出。利用换行符和空格来控制字符的位置,再使用特定的字符来构建整个场景。以下是一个可能的实现:
  1. #include <iostream>
  2. using namespace std;
  3. int main() {
  4.     cout << "                ********" << endl;
  5.     cout << "               ************" << endl;
  6.     cout << "               ####....#." << endl;
  7.     cout << "             #..###.....##...." << endl;
  8.     cout << "             ###.......######              ###                 ###           ###           ###" << endl;
  9.     cout << "                ...........               #...#               #...#         #...#         #...#" << endl;
  10.     cout << "               ##*#######                 #.#.#               #.#.#         #.#.#         #.#.#" << endl;
  11.     cout << "            ####*******######             #.#.#               #.#.#         #.#.#         #.#.#" << endl;
  12.     cout << "           ...#***.****.*###....          #...#               #...#         #...#         #...#" << endl;
  13.     cout << "           ....**********##.....           ###                 ###           ###           ###" << endl;
  14.     cout << "           ....****    *****...." << endl;
  15.     cout << "             ####        ####" << endl;
  16.     cout << "           ######        ######" << endl;
  17.     cout << "##############################################################              ##################################" << endl;
  18.     cout << "#...#......#.##...#......#.##...#......#.##------------------#              #...#......#.##------------------#" << endl;
  19.     cout << "###########################################------------------#              ###############------------------#" << endl;
  20.     cout << "#..#....#....##..#....#....##..#....#....#####################              #..#....#....#####################" << endl;
  21.     cout << "##########################################    #----------#                  ##############    #----------#" << endl;
  22.     cout << "#.....#......##.....#......##.....#......#    #----------#                  #.....#......#    #----------#" << endl;
  23.     cout << "##########################################    #----------#                  ##############    #----------#" << endl;
  24.     cout << "#.#..#....#..##.#..#....#..##.#..#....#..#    #----------#                  #.#..#....#..#    #----------#" << endl;
  25.     cout << "##########################################    ############                  ##############    ############" << endl;
  26.     return 0;
  27. }
复制代码

这段代码中,通过多次的cout语句按照场景的样式输出了相应的字符。每一行都以`endl`表示换行。最后返回0表示程序运行成功。

希望这个代码能够满足你的需求!

以上回复来自 FishC AI 小助理,如未能正确解答您的问题,请继续追问。
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-4-29 00:51

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表