听到一些事,明明不相干的也会在心里拐好几个弯想到你。
月遇丛云,花遇和风,今晚的夜空很美,我又想你。
环游了整个星系,找不到比你更亮的星。
小王子说,这个世界有几千几万朵玫瑰,但就是这一朵才是属于我自己的玫瑰。
明天就是520了,给大家带来一个适合新手程序员表白的代码:
先看看效果图吧:
最先是一个321倒计时
void countdown(void) //倒计时函数 { int temp, i, j; char Word[80] = " 时间有限,聊表心意~";
for (i = 0; Word[i] != NULL; i++) { cout << Word[i]; Sleep(50); } Sleep(1000);
system("cls"); void printchar(); for (temp = 3; temp >= 1; temp--) { switch
(temp) { case 1: for (i = 2; i <= 15; i++) { for (j = wide / 2; j <= wide / 2 +
1; j++)str[i][j] = 1; }break; case 2: for (i = 2; i <= 15; i++) { switch (i) {
case 2:case 3:case 8:case 9:case 14:case 15: for (j = wide / 2 - 7; j <= wide /
2 + 8; j++)str[i][j] = 1; break; case 4:case 5:case 6:case 7: for (j = wide / 2
+ 7; j <= wide / 2 + 8; j++)str[i][j] = 1; break; default: for (j = wide / 2 -
7; j <= wide / 2 - 6; j++)str[i][j] = 1; break; } }break; case 3: for (i = 2; i
<= 15; i++) { switch (i) { case 2:case 3:case 8:case 9:case 14:case 15: for (j
= wide / 2 - 7; j <= wide / 2 + 8; j++)str[i][j] = 1; break; default: for (j =
wide / 2 + 7; j <= wide / 2 + 8; j++)str[i][j] = 1; break; } }break; }
printchar(); Sleep(1000); for (i = 0; i < gao; i++) { for (j = 0; j < wide;
j++)str[i][j] = 0; } system("cls"); } Sleep(500); //system("cls");//清理屏幕 }
出来一个全是ta名字的爱心
接着会绘制一个小熊维尼
void bear_display(void) { system("cls");//清理屏幕 int i; char Word[80] = " Send
you a Teddy Bear"; for (i = 0; Word[i] != NULL; i++) { cout << Word[i];
Sleep(50); } cout << endl; cout << endl; cout << endl; cout << " ┴┬┴┬/ ̄\_/ ̄\"
<< endl; cout << " ┬┴┬┴▏ ▏▔▔▔▔\ " << endl; cout << " ┴┬┴/\ / ﹨ " << endl;
cout << " ┬┴∕ / ) " << endl; cout << " ┴┬▏ ● ▏ " << endl; cout
<< " ┬┴▏ ▔█ " << endl; cout << " ┴◢██◣ \___/ " << endl; cout <<
" ┬█████◣ / " << endl; cout << " ┴█████████████◣ " << endl; cout << "
◢██████████████▆▄ " << endl; cout << " █◤◢██◣◥█████████◤\ " << endl; cout << "
◥◢████ ████████◤ \ " << endl; cout << " ┴█████ ██████◤ ﹨ " << endl; cout
<< " ┬│ │█████◤ ▏ " << endl; cout << " ┴│ │ ▏ " <<
endl; cout << " ┬ ∕ ∕ /▔▔▔\ ∕ " << endl; cout << "
┴/___/﹨ ∕ ﹨ /\ " << endl; cout << " ┬┴┬┴┬┴\ \ ﹨/ ﹨ " << endl;
cout << " ┴┬┴┬┴┬┴ \___\ ﹨/▔\﹨ ▔\ " << endl; cout << " ▲△▲▲╓╥╥╥╥╥╥╥╥\ ∕
/▔﹨/▔﹨ " << endl; cout << " **╠╬╬╬╬╬╬╬╬*﹨ / // " << endl; Sleep(1000); for
(float y = 1.3; y >= -1.1; y -= 0.06) { for (float x = -1.1; x <= 1.1; x +=
0.025) if (x * x + pow(5.0 * y / 4.0 - sqrt(fabs(x)), 2) - 1 <= 0.0) cout <<
'*'; else cout << ' '; cout << endl; } Sleep(3000); }
最后为她绘制一朵玫瑰
完整的玫瑰代码可以看之前的文章哦!
void rose_display(void) { system("cls");//清理屏幕 int i; char Word[160] = "
世界上也有五千朵一模一样的花,但只有你是我独一无二的玫瑰"; for (i = 0; Word[i] != NULL; i++) { cout <<
Word[i]; Sleep(50); } puts("\033[91m"); for (int y = 0; y < 80; y++) { for (int
x = 0; x < 160; x++) putchar(" .,-:;+=*#@"[(int)(f(make2((x / 160.0f - 0.5f) *
2.0f, (y / 80.0f - 0.5f) * -2.0f)) * 12.0f)]); putchar('\n'); } }
需要这个完整源码的小伙伴可以进下企鹅裙【8060】【41599】找管理员领取