感谢任奕晟同学提供
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
void gotoxy(int x,int y){
COORD c;
c.X = x - 1;
c.Y = y - 1;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),c);
}
void SetColor(unsigned short ForeColor=7,unsigned short BackGroundColor=0)
{
HANDLE hCon=GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(hCon,ForeColor|BackGroundColor);
}
int i=0,zl=1;
int main() {
//for (int i=0;i<16;i++) {SetColor(i);cout<<123456<<endl;} //输出色谱
SetColor(9);
while(1){
cout<<" ▁ ▂ ▃ ▄▅ ▆ ▇ █▇ ▆ ▅ ▄▃ ▂ ▁ ︿( ̄︶ ̄)︿︿( ̄︶ ̄)︿︿( ̄︶ ̄)︿︿( ̄︶ ̄)︿︿( ̄︶ ̄)︿ 111111111111111111111111111111111111111▁ ▂ ▃ ▄▅ ▆ ▇ █▇ ▆ ▅ ▄▃ ▂ ▁ 1111111111 11111111 111111111";
_sleep(i); //调节速度
i+=zl;
if (i>=100 || i<=0) zl=zl*-1; //延时在0至100之间循环
}
return 0;
}
浙公网安备 33010602011771号