Hello大家好,我是阳了个阳C++。洛谷这个网站各位想必已经非常熟悉了,几乎是每位学习编程的人都会经常访问这个网站。
所以我计划从今天开始,除了更新一些C++小游戏外,还会发布一些洛谷的题解,希望大家喜欢。
特别声明:本文所有代码均为原创!!!
P1000:
题目:
超级玛丽游戏
题目描述
超级玛丽是一个非常经典的游戏。请你用字符画的形式输出超级玛丽中的一个场景。
********
************
####....#.
#..###.....##....
###.......###### ### ###
........... #...# #...#
##*####### #.#.# #.#.#
####*******###### #.#.# #.#.#
...#***.****.*###.... #...# #...#
....**********##..... ### ###
....**** *****....
#### ####
###### ######
##############################################################
#...#......#.##...#......#.##...#......#.##------------------#
###########################################------------------#
#..#....#....##..#....#....##..#....#....#####################
########################################## #----------#
#.....#......##.....#......##.....#......# #----------#
########################################## #----------#
#.#..#....#..##.#..#....#..##.#..#....#..# #----------#
########################################## ############
(这里和洛谷的字体不同,所以看着和原图不太一样,大家不要在意)
这道题算是洛谷的一个入门题,那么代码如下:
#include<bits/stdc++.h>
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;
}
P1001:
题目:
A+B Problem
题目描述
输入两个整数 a, b,输出它们的和。
输入格式
两个以空格分开的整数。
输出格式
一个整数。
这道题也是一道极其简单的题目,代码如下:
#include <iostream>
#include <cstdio>
using namespace std;
int main(){
int a,b;
cin>>a>> b;
cout<<a+b<<endl;
return 0;
}
今天的题解就到这里了,希望大家喜欢。
(作者悄悄地问一句,复制代码的时候能不能点个赞)