话不多说上代码
#include<iostream>
#include<windows.h>
using namespace std;
void gotoxy(int y,int x){
COORD pos;
pos.X=x;
pos.Y=y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),pos);
}
int main(){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_GREEN | FOREGROUND_RED);
int a,b,c=30;
while(1==1)
{
cin>>b;
if(b==2)
c=c+2;
if(b==1)
c=c-2;
if(c>=118)
{
c=118;
}
if(c<=0)
{
c=1;
}
gotoxy(1,1);
cout<<"_______________________________________________________________________________________________________________________";
gotoxy(20,1);
cout<<"___________________________________________________________________________________________________________{win}_______";
gotoxy(19,c);
cout<<"人"<<endl;
system("cls");
gotoxy(1,1);
cout<<"_______________________________________________________________________________________________________________________";
gotoxy(20,1);
cout<<"___________________________________________________________________________________________________________{win}_______";
gotoxy(19,c);
cout<<"人"<<endl;
}
return 0;
}