#include
#include
#include
#include
#include
#include
#include
using namespace std;
void gotoxyzimu(int x, int y) {//位置函数(行为x 列为y)字母
COORD pos;
pos.X=y;
pos.Y=x;
SetConsoleCursorPosition (GetStdHandle (STD_OUTPUT_HANDLE),pos);
}
void gotoxyhanzi(int x, int y) {//位置函数(行为x 列为y)汉字(兼容字母但有空格偏位)
COORD pos;
pos.X=y*2;
pos.Y=x;
SetConsoleCursorPosition (GetStdHandle (STD_OUTPUT_HANDLE),pos);
}
int main()
{
cout<<"##########\n";
cout<<"##########\n";
cout<<"##########\n";
cout<<"##########\n";
cout<<"##########\n";
cout<<"##########\n";
cout<<"##########\n";
for (int i = 1; i <= 3; i++) {
gotoxyzimu(1,i);
cout<<"h";
Sleep(1000);
gotoxyzimu(2,i);
cout<<"e";
Sleep(1000);
gotoxyzimu(3,i);
cout<<"l";
Sleep(1000);
gotoxyzimu(4,i);
cout<<"l";
Sleep(1000);
gotoxyzimu(5,i);
cout<<"o";
Sleep(1000);
gotoxyhanzi(1,i);
cout<<"哈";
Sleep(1000);
gotoxyhanzi(2,i);
cout<<"喽";
Sleep(1000);
gotoxyhanzi(3,i);
cout<<"啊";
Sleep(1000);
gotoxyhanzi(4,i);
cout<<"喽";
Sleep(1000);
gotoxyhanzi(5,i);
cout<<"哈";
Sleep(1000);
}
Sleep(10000);
return 0;
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)