废话不多说,直接上代码
#include<iostream>
#include<windows.h>
using namespace std;
void GotoXY(int x, int y) // 移动
{
HANDLE hout; //屏幕尺寸 变量
COORD coord={ x,y}; //光标坐标 变量 光标x标 光标y标
hout=GetStdHandle(STD_OUTPUT_HANDLE); //获得屏幕尺寸
SetConsoleCursorPosition(hout,coord); //移动光标
}
int main()
{
cout<<0;
GotoXY(0,1);
system("pause");
system("cls");
int x=0;
for (int i=1;i<=40;i++)
{
GotoXY(x,0);
cout<<" ";
x++;
GotoXY(x,0);
cout<<0;
Sleep(15);
}
int y=0;
for (int i=1;i<=15;i++)
{
GotoXY(x,y);
cout<<" ";
y++;
GotoXY(x,y);
cout<<"0";
Sleep(20);
}
GotoXY(x,y+1);
for (int i=1;i<=6;i++)
{
GotoXY(x,y);
if (i==1)
{
cout<<"你";
}
if (i==2)
{
cout<<" ";
}
if (i==3)
{
cout<<"好";
}
else
{
cout<<".";
}
x++;
GotoXY(x,y);
cout<<"0";
Sleep(20);
}
GotoXY(x,y+1);
system("pause");
system("cls");
for (int i=1;i<=6;i++)
{
GotoXY(x,y);
cout<<" ";
x--;
GotoXY(x,y);
cout<<"0";
Sleep(20);
}
Sleep(60);
for (int i=1;i<=6;i++)
{
GotoXY(x,y);
cout<<" ";
y--;
GotoXY(x,y);
cout<<"0";
Sleep(25);
}
for (int i=1;i<=7;i++)
{
GotoXY(x,y);
cout<<" ";
x++;
GotoXY(x,y);
cout<<0;
Sleep(15);
}
GotoXY(x-5,y);
cout<<"请";
Sleep(50);
cout<<"写";
Sleep(50);
cout<<"出";
Sleep(50);
cout<<"姓";
Sleep(50);
cout<<"名";
Sleep(50);
cout<<":";
GotoXY(x,y);
cout<<" ";
y++;
GotoXY(x,y);
cout<<0;
Sleep(25);
for (int i=1;i<=7;i++)
{
GotoXY(x,y);
cout<<" ";
x++;
GotoXY(x,y);
cout<<0;
Sleep(20);
}
GotoXY(x,y-1);
string name;
cin>>name;
Sleep(17);
GotoXY(x-11,y-1);
for (int i=1;i<=6;i++)
{
cout<<" ";
Sleep(20);
}
for (int i=1;i<=5;i++)
{
GotoXY(x,y);
cout<<" ";
x--;
GotoXY(x,y);
cout<<0;
Sleep(20);
}
for (int i=1;i<=2;i++)
{
GotoXY(x,y);
if (i==2)
{
cout<<"您";
}
else
{
cout<<" ";
}
y--;
GotoXY(x,y);
cout<<0;
Sleep(25);
}
Sleep(600);
GotoXY(x,y);
cout<<" ";
y--;
GotoXY(x,y);
cout<<0;
Sleep(85);
GotoXY(x,y);
cout<<" ";
y++;
GotoXY(x,y);
cout<<0;
Sleep(35);
GotoXY(x+1,y+1);
cout<<"好";
Sleep(65);
cout<<",";
Sleep(65);
cout<<" ";
Sleep(65);
GotoXY(x,y+2);
system("pause");
}
还没有评论,来说两句吧...