学习C++从娃娃抓起!记录下洛谷C++学习和备考过程中的题目,记录每一个瞬间。
附上汇总贴:洛谷刷题C++语言 | 汇总_热爱编程的通信人的博客-CSDN博客
【题目描述】
超级玛丽是一个非常经典的游戏。请你用字符画的形式输出超级玛丽中的一个场景。
********
************
####....#.
#..###.....##....
###.......###### ### ###
........... #...# #...#
##*####### #.#.# #.#.#
####*******###### #.#.# #.#.#
...#***.****.*###.... #...# #...#
....**********##..... ### ###
....**** *****....
#### ####
###### ######
##############################################################
#...#......#.##...#......#.##...#......#.##------------------#
###########################################------------------#
#..#....#....##..#....#....##..#....#....#####################
########################################## #----------#
#.....#......##.....#......##.....#......# #----------#
########################################## #----------#
#.#..#....#..##.#..#....#..##.#..#....#..# #----------#
########################################## ############
【输入】
无
【输出】
如描述
【输入样例】
无
【输出样例】
无
【代码详解】
#include <iostream>
using namespace std;
int main()
{
cout << " ********" << endl;
cout << " ************" << endl;
cout << " ####....#." << endl;
cout << " #..###.....##...." << endl;
cout << " ###.......###### ### ###" << endl;
cout << " ........... #...# #...#" << endl;
cout << " ##*####### #.#.# #.#.#" << endl;
cout << " ####*******###### #.#.# #.#.#" << endl;
cout << " ...#***.****.*###.... #...# #...#" << endl;
cout << " ....**********##..... ### ###" << endl;
cout << " ....**** *****...." << endl;
cout << " #### ####" << endl;
cout << " ###### ######" << endl;
cout << "##############################################################" << endl;
cout << "#...#......#.##...#......#.##...#......#.##------------------#" << endl;
cout << "###########################################------------------#" << endl;
cout << "#..#....#....##..#....#....##..#....#....#####################" << endl;
cout << "########################################## #----------#" << endl;
cout << "#.....#......##.....#......##.....#......# #----------#" << endl;
cout << "########################################## #----------#" << endl;
cout << "#.#..#....#..##.#..#....#..##.#..#....#..# #----------#" << endl;
cout << "########################################## ############" << endl;
return 0;
}
【运行结果】
********
************
####....#.
#..###.....##....
###.......###### ### ###
........... #...# #...#
##*####### #.#.# #.#.#
####*******###### #.#.# #.#.#
...#***.****.*###.... #...# #...#
....**********##..... ### ###
....**** *****....
#### ####
###### ######
##############################################################
#...#......#.##...#......#.##...#......#.##------------------#
###########################################------------------#
#..#....#....##..#....#....##..#....#....#####################
########################################## #----------#
#.....#......##.....#......##.....#......# #----------#
########################################## #----------#
#.#..#....#..##.#..#....#..##.#..#....#..# #----------#
########################################## ############