请问如何在C ++中围绕文本创建断开的矩形虚线边框 [英] Please how do I create broken rectangular dashed border around a text in C++

查看:76
本文介绍了请问如何在C ++中围绕文本创建断开的矩形虚线边框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请问如何在C ++文本周围创建破碎的矩形虚线边框



像这样:

 ---------------------------- 
|橙色|
| 2.苹果|
|芒果|
|菠萝|
| |
----------------------------





我尝试了什么:



请问如何在文本周围创建破碎的矩形虚线边框C ++

解决方案

 std :: cout<<   ------------------------- ---<<的std :: ENDL; 
std :: cout<< | 1. orange |<<的std :: ENDL;
std :: cout<< | 2. apple |<<的std :: ENDL;
std :: cout<< | 3. mango |<<的std :: ENDL;
std :: cout<< | 4. pineapple |<<的std :: ENDL;
std :: cout<< | |<<的std :: ENDL;
std :: cout<< ------------------------- - <<的std :: ENDL;


Please how do I create broken rectangular dashed border around a text in C++

Like this:

 ----------------------------
|  1. orange                 |
|  2. apple                  |
|  3. mango                  |
|  4. pineapple              |
|                            |
 ----------------------------



What I have tried:

Please how do I create broken rectangular dashed border around a text in C++

解决方案

std::cout << " ---------------------------- " << std::endl;
std::cout << "|  1. orange                 | " << std::endl;
std::cout << "|  2. apple                  | " << std::endl;
std::cout << "|  3. mango                  | " << std::endl;
std::cout << "|  4. pineapple              | " << std::endl;
std::cout << "|                            | " << std::endl;
std::cout << " ---------------------------  " << std::endl;


这篇关于请问如何在C ++中围绕文本创建断开的矩形虚线边框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆