话不多说上代码
#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<<"_______________________________________________________________________________________________________________________";