标签:clu name char color mes 技术分享 col ios str
重要的事情说三遍 : 可以转载!可以转载!可以转载!
我看网上很难找到羊驼的代码,所以决定自己写一个玩,代码没什么科技含量!
仅供娱乐哦!
代码如下:
1 #include "stdafx.h" 2 #include<iostream> 3 #include<iomanip> 4 using namespace std; 5 int main() 6 { 7 const char* str0 = "┌─┐"; 8 const char* str1 = "┌──┘"; 9 const char* str2 = "┴───────┘"; 10 const char* str3 = "┴──┐"; 11 const char* str4 = "│"; 12 const char* str5 = "──"; 13 const char* str6 = "─┬┘"; 14 const char* str7 = "└┬─"; 15 const char* str8 = "─┴─"; 16 const char* str9 = "└───┐"; 17 const char* str10 = "┌───┘"; 18 const char* str11 = "└──────────────┐"; 19 const char* str12 = "├─┐"; 20 const char* str13 = "┌─┘ "; 21 const char* str14 = "└─┐"; 22 const char* str15 = "┐"; 23 const char* str16 = "┌───────┬──┐"; 24 const char* str17 = "┌──┘"; 25 const char* str18 = "┤"; 26 const char* str19 = "└──┴──┘"; 27 cout << setw(31) << str0 << setw(13) << str0 << endl; 28 cout <<setw(30)<< str1 <<setw(19)<<str2<<setw(9)<<str3<< endl; 29 cout << setw(24) << str4 <<setw(19)<<str4<< endl; 30 cout << setw(24) << str4 << setw(11) <<str5<<setw(10)<< str4 << endl; 31 cout << setw(24) << str4 << setw(19) << str4 << endl; 32 cout << setw(24) << str4 << setw(9) << str6 << setw(11) << str7 << setw(5) << str4 << endl; 33 cout << setw(24) << str4 << setw(19) << str4 << endl; 34 cout << setw(24) << str4 << setw(19) << str4 << endl; 35 cout << setw(24) << str4 << setw(13) << str8 <<setw(9)<<str4<< endl; 36 cout << setw(24) << str4 << setw(19) << str4 << endl; 37 cout << setw(32) << str9 << setw(19)<< str10 << endl; 38 cout << setw(28) << str4 << setw(11) << str4 << endl; 39 cout << setw(28) << str4 << setw(11) << str4 << endl; 40 cout << setw(28) << str4 << setw(11) << str4 << endl; 41 cout << setw(28) << str4 << setw(11) << str4 << endl; 42 cout << setw(28) << str4 << setw(41) << str11 << endl; 43 cout << setw(28) << str4 << setw(26) << str4 << endl; 44 cout << setw(28) << str4 << setw(30) << str12 << endl; 45 cout << setw(28) << str4 << setw(32) << str13 << endl; 46 cout << setw(28) << str4 << setw(26) << str4 << endl; 47 cout << setw(32) << str14 <<setw(4)<<str15<<setw(26)<<str16<<setw(10)<<str17<< endl; 48 cout << setw(30) << str4 <<setw(4)<<str18<<setw(4)<<str18<<setw(9)<<str4<<setw(4)<<str18 49 <<setw(4)<<str18<< endl; 50 cout << setw(42) << str19 <<setw(21)<<str19<< endl; 51 cout << " " << endl; 52 cout << setw(43) << "神兽保佑"<<endl; 53 cout << " " << endl; 54 cout << setw(43) << "永无bug!" << endl; 55 return 0; 56 }
注:setw()这个是个相当于打印空格的函数,需要#include<iomanip>头文件支持。
运行结果:
标签:clu name char color mes 技术分享 col ios str
原文地址:https://www.cnblogs.com/Trojan00/p/8892502.html