parts.cpp
来自「C++&datastructure书籍源码,以前外教提供现在与大家共享」· C++ 代码 · 共 54 行
CPP
54 行
#include <iostream>using namespace std;// procedures used to print different headsvoid PartedHair()// prints a "parted hair" scalp { cout << " |||||||///////// " << endl;}void Hair()// prints a "straight-up" or "frightened" scalp { cout << " |||||||||||||||| " << endl;}void Sides()// prints sides of a head -- other functions should use distance// between sides of head here as guide in creating head parts (e.g., eyes){ cout << " | | " << endl;}void Eyes()// prints eyes of a head (corresponding to distance in Sides) { cout << " | o o | " << endl;}void Ears()// prints ears (corresponding to distance in Sides) { cout << " _| |_ " << endl; cout << "|_ _|" << endl;}void Smile()// prints smile (corresponding to distance in Sides) { cout << " | |______| | " << endl;}int main(){ Hair(); Sides(); Eyes(); Ears(); Smile(); Sides(); return 0;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?