今天我又双叒叕打开题库,回顾老题(好吧根本没做过)。第一眼一看:好家伙,P1000超级玛丽。这名字……不会是想要我们编游戏吧!
点进去看了看,才反应过来,一点也不难好吧……
题目让我们输出一个超级玛丽里的场景,直接无脑输出就行了。
代码:
#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;
}
就很多。
建议各位别用手打,Ctrl+c总会吧……
代码解析:
#include<iostream>
/*c++头文件,i=input,o=output。意思为输入输出流。是c++的一个常用库。*/
// //是注释。可以为代码做解释。/* */是多行注释。
using namespace std;
//申请使用标准库函数(写了这个代码后面用cin、cout这些就不用打std::了)
int main(){//主函数,程序要在这里运行
}
int main(){
return 0;//退出程序
}
cout<<""<<endl;
//cout<<是输出,后面接内容。""是字符串,里面写内容。endl是换行符。cout一个<<只能接一个内容,要写下一个内容就要再打一个<<。
函数框架:
//函数框架
#include<iostream>
using namespace std;
int main(){//内容要缩进。
//内容;
return 0;
}
最后求一波赞,各位萌新可以加入我的团队“萌新……”。