- C24zhuchengyu's blog
《开灯》
- @ 2024-7-16 20:39:23
总感觉这个代码运行起来怪怪的....................
#include<bits/stdc++.h>
using namespace std;
void setup(){
cout<<"调整大小至所有“*”号在窗口内(包括此行和最后的提示):"<<endl;
for(int i=0;i<99;i++){
cout<<"*";
}
cout<<endl;
for(int i=0;i<27;i++){
cout<<"*"<<endl;
}
system("pause");
}
int main(){
int n=0;
setup();
int a,b,c;
cout<<"RGB初始值(0~255):";
cin>>a>>b>>c;
system("title");
cout<<"\033[38;2;255;255;255m";
while(a<255||b<255||c<255){
char d[101],e[101],f[101];
a+=4;
b+=4;
c+=4;
a=abs(a);
b=abs(b);
c=abs(c);
if(a>255)a=255;
if(b>255)b=255;
if(c>255)c=255;
itoa(a,d,10);
itoa(b,e,10);
itoa(c,f,10);
cout<<"\033[48;2;"<<d<<";"<<e<<";"<<f<<"m";
for(int i=0;i<100;i++){
for(int j=0;j<30;j++){
cout<<" ";
}
cout<<endl;
}
}
float k=0;
while(k<1000){
cout<<" ";
k+=0.5;
}
return 0;
}