生日快乐歌(程序员版)
程序在DEV-C++中编译通过,调用Win32 API,演奏出唯美的歌曲.....
- #include<windows.h>
- void Birthday();
- int main()
- {
- Birthday();
- return 0;
- }
- void Birthday()
- {
- unsigned frequency[]={392,392,440,392,523,494,
- 392,392,440,392,587,523,
- 392,392,784,659,523,494,440,
- 698,698,659,523,587,523};
- unsigned delay[]={375,125,500,500,500,1000,
- 375,125,500,500,500,1000,
- 375,125,500,500,500,500,1000,
- 375,125,500,500,500,1000,};
- for(int i=0;i<25;i++)
- {
- Beep (frequency[i],delay[i]);
- }
- }
posted on 2010-08-27 18:51 hicjiajia 阅读(3320) 评论(0) 编辑 收藏 举报