#include<stdio.h>
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 play_music()//奏乐
int main(int argc, char *argv[])
{
puts("happy birthday ! \n")
play_music()
return 0
}
void play_music()
{
int i = 0
for(i <25++i)
{
Beep(rhythm[i]*5, delay[i])
if(i == 24)
{
Sleep(500)
i = 0
}
}
}
easy....直接printf就好啦:#include
int main()
{
printf ("我是一名大学生!\n")
printf ("我喜爱c语言!\n")
return 0
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)