#include
#include
#include
#include
#include
#include // 使用该计时器必须包含的文件
#define _CRT_SECURE_NO_WARNINGS
#pragma comment ( lib, "Winmm.lib" )
void Welcome();
void wait(float seconds)
{
clock_t endwait;
endwait = clock() + seconds * CLK_TCK;
while (clock() < endwait) {}
}
// 主函数
void main()
{
initgraph(1366, 768);
srand(unsigned int(time(NULL))); //随机因子
Welcome();
}
void Welcome()
{
//播放背景音乐
mciSendString("open .//fire//bk.mp3 alias bk", 0, 0, 0); //获取到音乐文件的路径
mciSendString("play bk repeat", 0, 0, 0); //播放
//文字的输出
settextstyle(100, 0, "隶书"); //设置字体的风格
setcolor(LIGHTMAGENTA); //设置字体的颜色
outtextxy(240, 100, "T E A C H E R"); //在指定的坐标(480,100)输出文字
settextstyle(80, 0, "");
outtextxy(0, 300, "H O L I D A Y H A P P Y");
wait(2);
cleardevice(); //刷新屏幕
settextstyle(40, 0, "隶书");
setcolor(YELLOW);
outtextxy(200, 50, "四 度 春 风 化 绸 缪,");
wait(1);
outtextxy(200, 100, "几 番 秋 雨 洗 鸿 沟。");
wait(1);
outtextxy(200, 150, "黑 发 积 霜 织 日 月,");
wait(1);
outtextxy(200, 200, "粉 笔 无 言 写 春 秋。");
wait(1);
outtextxy(200, 250, "蚕 丝 吐 尽 春 未 老,");
wait(1);
outtextxy(200, 300, "烛 泪 成 灰 秋 更 稠。");
wait(1);
outtextxy(200, 350, "春 播 桃 李 三 千 圃,");
wait(1);
outtextxy(200, 400, "秋 来 硕 果 满 神 州。");
wait(10);
system("pause");
}