用C++打印一个别墅
时间: 2024-02-13 17:00:01 浏览: 25
您可以尝试使用C++的输出流来打印别墅,以下是一个简单的例子:
```c++
#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;
return 0;
}
```
输出结果如下:
```
/\
/ \
/ \
/ \
/________\
| |
| |
| |
|________|
| |
| |
| |
|________|
| |
| |
| |
|________|
| |
| |
| |
|________|
```
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)