生日快乐代码

时间:2022-05-19 18:25:13 阅读: 最新文章 文档下载
说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。
生日快乐代码

#include #include

DWORD WINAPI play_music(PVOID pParam); DWORD WINAPI pray(PVOID pParam); unsigned int rhythm[] = {

0x188, 0x188, 0x1B8, 0x188, 0x20B, 0x1EE,0x188, 0x188, 0x1B8, 0x188, 0x24B, 0x20B,0x188, 0x188, 0x310, 0x293, 0x20B, 0x1EE,0x1B8, 0x2BA, 0x2BA, 0x293, 0x20B, 0x24B,0x20B

};

unsigned int delay[] = {

0x177, 0x07D, 0x1F4, 0x1F4, 0x1F4, 0x3E8,0x177, 0x07D, 0x1F4, 0x1F4, 0x1F4, 0x3E8,0x177, 0x07D, 0x1F4, 0x1F4, 0x1F4, 0x1F4, 0x3E8,0x177, 0x07D, 0x1F4, 0x1F4, 0x1F4, 0x3E8,};

void main() {

HANDLE threadTest[2]; int i=1,j=2;

threadTest[0]=CreateThread(NULL,0,play_music,NULL,0,0); threadTest[1]=CreateThread(NULL,0,pray,NULL,0,0); WaitForMultipleObjects(2,threadTest,true,INFINITE); }

DWORD WINAPI play_music(PVOID pParam) {


int i = 0; for(; i < 25; ++i) {

Beep(rhythm[i]*5, delay[i]); if(i == 24) {

Sleep(500); i = 0; } } return 0; }

DWORD WINAPI pray(PVOID pParam){ int i=0;

char c[]=" ,今天是你的生日,Happy Birthday:愿所有的快, 亲亲亲有的幸福,所有的温馨,所有的好运永在你身亲亲亲亲亲亲亲! O(?_?)O";

system("color 5e"); printf("\n\n\n");

printf(" \n"); printf(" \n");??

printf(" %s \n", "XXX");?? printf(" ?生日快? \n"); printf(" \n");??

printf(" \n");printf("\n\n");


for(i=0;i<56;i++) {

printf("%c",c[i]); Sleep(100); }

printf("\n\n"); Sleep(100);

for(i=56;i<135;i++) {

printf("%c",c[i]); Sleep(100); }

printf("\n\n"); system("pause"); return 0; }


本文来源:https://www.wddqw.com/doc/f1ffa4ec78563c1ec5da50e2524de518974bd37b.html