close
#include
#include
using namespace std;
void gotoxy(int xpos, int ypos)
{
COORD scrn;
HANDLE hOuput = GetStdHandle(STD_OUTPUT_HANDLE);
scrn.X = xpos; scrn.Y = ypos;
SetConsoleCursorPosition(hOuput,scrn);
}
int main()
{
string s="Hello!";
int len=s.length();
while(1)
{
gotoxy(0,0);
cout<
for(int i=0;i<80-len;i++)
{
Sleep(150);
gotoxy(i,0);
cout<<' '<
}
for(int i=80-len;i>-1;i--)
{
Sleep(50);
gotoxy(i,0);
cout<
}
}
}
全站熱搜
留言列表