1. 程式人生 > >娛樂之神獸羊駝(原創)

娛樂之神獸羊駝(原創)

str1 重要 iostream src clu 網上 tr1 img mil

重要的事情說三遍 : 可以轉載!可以轉載!可以轉載!

我看網上很難找到羊駝的代碼,所以決定自己寫一個玩,代碼沒什麽科技含量!

僅供娛樂哦!

代碼如下:

 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>頭文件支持。

運行結果:

技術分享圖片

娛樂之神獸羊駝(原創)