今天向大家分享一个自己编的C++星星_show。
程序运用了rand()随机函数,用法略。
大家运行一下,很炫酷!(可复制代码)
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
#define intc(n); int n;cin>>n;
#define int_ass(n,m); int n=m;
#define str_ass(s,t); string s=t;
#define strc(s); string s;cin>>s;
#define qfor(i,n) for(int i=0;i<n;i++)
#define qw(tc) while(tc--)
#define pb push_back
#define popb pop_back
int main(){
for(;;)
{
srand(time(0));
string s="★";
cout<<s;
Sleep(0);
int endd;
char ce;
endd=rand()%100+0;
ce=rand()%'A'+15;
if(ce=='G')
{
system("color 0");
}
else if(ce=='H')
{
system("color 1");
}
else if(ce=='I')
{
system("color 2");
}
else if(ce==