1.1编程基础之输入输出
超级玛丽游戏
知道cout的用法就好说 呵呵其实当时也看懵了
“一个cout语句可以分写成若干行。如: cout<<“This is a simple C++ program.”<<endl; 可以写成 cout<<"This is " //注意行末尾无分号 <<"a C++ " <<“program.” <<endl; //语句最后有分号 也可写成多个cout语句,即 cout<<"This is "; //语句末尾有分号 cout <<"a C++ "; cout <<“program.”; cout<<endl; 以上3种情况的输出均为: This is a simple C++ program.” -来自百度
#include <iostream>
#include <string>
#include <cstdio>
using namespace std;
int main()
{
cout << " ********" << endl;
<< " ************" << endl;
<< " ####....#." << endl;
<< " #..###.....##...." << endl;
<< " ###.......###### ### ### ### ###" << endl;
<< " ........... #...# #...# #...# #...#" << endl;
<< " ##*####### #.#.# #.#.# #.#.# #.#.#" << endl;
<< " ####*******###### #.#.# #.#.# #.#.# #.#.#" << endl;
<< " ...#***.****.*###.... #...# #...# #...# #...#" << endl;
<< " ....**********##..... ### ### ### ###" << endl;
<< " ....**** *****...." << endl;
<< " #### ####" << endl;
<< " ###### ######" << endl;
<< "############################################################## ##################################" << endl;
<< "#...#......#.##...#......#.##...#......#.##------------------# #...#......#.##------------------#" << endl;
<< "###########################################------------------# ###############------------------#" << endl;
<< "#..#....#....##..#....#....##..#....#....##################### #..#....#....#####################" << endl;
<< "########################################## #----------# ############## #----------#" << endl;
<< "#.....#......##.....#......##.....#......# #----------# #.....#......# #----------#" << endl;
<< "########################################## #----------# ############## #----------#" << endl;
<< "#.#..#....#..##.#..#....#..##.#..#....#..# #----------# #.#..#....#..# #----------#" << endl;
<< "########################################## ############ ############## ############" << endl;
return 0;
}
|