娱乐之神兽羊驼(原创)
生活随笔
收集整理的這篇文章主要介紹了
娱乐之神兽羊驼(原创)
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
重要的事情說(shuō)三遍 : 可以轉(zhuǎn)載!可以轉(zhuǎn)載!可以轉(zhuǎn)載!
我看網(wǎng)上很難找到羊駝的代碼,所以決定自己寫一個(gè)玩,代碼沒(méi)什么科技含量!
僅供娛樂(lè)哦!
代碼如下:
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) << "永無(wú)bug!" << endl; 55 return 0; 56 }注:setw()這個(gè)是個(gè)相當(dāng)于打印空格的函數(shù),需要#include<iomanip>頭文件支持。
運(yùn)行結(jié)果:
轉(zhuǎn)載于:https://www.cnblogs.com/Trojan00/p/8892502.html
總結(jié)
以上是生活随笔為你收集整理的娱乐之神兽羊驼(原创)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: hcl出现“Invalid cipher
- 下一篇: JButton:按钮组件