娱乐之佛像(转载)
以下代码为博主在网上搜寻的,只用于娱乐一下下哦。
1 #include <stdio.h> 2 #include <string.h> 3 void PrintCenterAlign(char *pStr, int Len) 4 { 5 int lSpaceNum = (Len - strlen(pStr)) / 2; 6 7 printf("%*s\n", lSpaceNum + strlen(pStr), pStr); 8 } 9 10 void PrintGodBless(void) 11 { 12 PrintCenterAlign("_ooOoo_", 100); 13 PrintCenterAlign("o8888888o", 100); 14 PrintCenterAlign("88\" . \"88", 100); 15 PrintCenterAlign("(| -_- |)", 100); 16 PrintCenterAlign("O\\ = /O", 100); 17 PrintCenterAlign("____/'---'\\____", 100); 18 PrintCenterAlign(".' \\\\| |// '.", 100); 19 PrintCenterAlign("/ \\\\||| : |||// \\", 100); 20 PrintCenterAlign("/ _||||| -:- |||||- \\", 100); 21 PrintCenterAlign("| | \\\\\\ - /// | |", 100); 22 PrintCenterAlign("| \\_| ''\\---/'' |_/", 100); 23 PrintCenterAlign("\\ .-\\__ `-` ___/-. /", 100); 24 PrintCenterAlign("___`. .' /--.--\\ `. . __", 100); 25 PrintCenterAlign(".\"\" '< `.___\\_<|>_/___.' >'\"\".", 100); 26 PrintCenterAlign("| | : `- \\`.;`\\ _ /`;.`/ - ` : | |", 100); 27 PrintCenterAlign("\\ \\ `-. \\_ __\\ /__ _/ .-` / /", 100); 28 PrintCenterAlign("======`-.____`-.___\\_____/___.-`____.-'======", 100); 29 PrintCenterAlign("`=---='", 100); 30 printf("\n"); 31 PrintCenterAlign("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^", 100); 32 PrintCenterAlign(" *God Bless Never Crash* ", 100); 33 } 34 35 int main(int argc, char *argv[]) 36 { 37 PrintGodBless(); 38 }
结果如下:
答曰:
1 #include "stdafx.h" 2 #include<iostream> 3 using namespace std; 4 int main() 5 { 6 cout << " " << endl; 7 cout << " _ooOoo_ " << endl; 8 cout << " o8888888o " << endl; 9 cout << " 88\" . \"88" << endl; 10 cout << " (| -_- |) " << endl; 11 cout << " O\\ = /O" << endl; 12 cout << " ___/`---'\\____ " << endl; 13 cout << " . ' \\| |// `. " << endl; 14 cout << " / \\\\||| : |||// \\ "<<endl;; 15 cout << " / _||||| -:- |||||- \\ "<<endl; 16 cout << " | | \\\\\\ - /// | | " << endl; 17 cout << " | \\_| ''\\---/'' | | " << endl; 18 cout << " \\ .-\\__ `-` ___/-. / " << endl; 19 cout << " ___`. .' /--.--\\ `. . __ " << endl; 20 cout << " ."" '< `.___\\_<|>_/___.' >'"". " << endl; 21 cout << " | | : `- \\`.;`\\ _ /`;.`/ - ` : | | " << endl; 22 cout << " \\ \\ `-. \\_ __\\ /__ _/ .-` / / " << endl; 23 cout << " ======`-.____`-.___\\_____/___.-`____.-'====== " << endl; 24 cout << " `=---=' " << endl; 25 cout << " ............................................." << endl; 26 cout << " 佛曰:bug泛滥,我已瘫痪!" << endl; 27 return 0; 28 }
结果如下: