用户猜测系统

· · 个人记录

欢迎投稿,请以函数的形式投稿,表明函数名字为get***。

#include<bits/stdc++.h>
using namespace std;
string kn[19][2];
int inn=7;
int o;
int a,b,c,d,e;
int h;
string s;
string name,head;
int top;
string lx;
void getguzhi(){
    a=rand()%11;
    if(a==1){
        a=40;
    }else if(a==0){
        a=0;
    }else{
        a=100;
    }
    b=rand()%101;
    c=rand()%3;
    if(c==0){
        c=0;
    }else if(c==1){
        c=rand()%70+1;
    }else{
        c=rand()%30+71;
    }
    d=rand()%2;
    if(d==0){
        d=rand()%100;
    }else{
        d=100;
    }
    e=rand()%2;
    if(e==0){
        e=0;
    }else{
        e=rand()%8+3;
        e=(e-1)*10+rand()%2*5;
        if(e==95){
            e+=5;
        }
    }
}
void getnamecolor(){
    if(((e>=50&&a+b+c+d+e>=230)||(e>=70))&&rand()%5==0){
        h=0;
    }else if(rand()%10==0){
        h=-1;
    }else{
        int zzz;
        zzz=a+b+c+d+e;
        if(zzz<100){
            h=1;
        }else if(zzz<130){
            h=2;
        }else if(zzz<170){
            h=3;
        }else if(zzz<230){
            h=4;
        }else{
            h=5;
        }
    }
    if(h&&rand()%100==0){
        h=-2;
    }
}
void gettag(){
    if(h>=1&&h<=4){
        if(rand()%20==0){
            s=kn[rand()%inn][0];
        }else{
            s="暂无标签";
        }
    }else if(h==5){
        if(rand()%12==0){
            s=kn[rand()%inn][rand()%2];
        }else{
            s="暂无标签";
        }
    }else if(h==-1){
        s="作弊者";
    }else if(h==0){
        if(rand()%2==0){
            s=kn[rand()%inn][1];
        }else{
            s="暂无标签";
        }   
    }else if(h==-2){
        s="暂无标签";
    }
}
void getname(){
    if(h==-2){
        name="\"封禁用户\"";
    }else{
        name="欢迎投稿"; 
    }
}
void gethead(){
    if(h==-2){
        head="\"封禁用户洛谷\"";
    }else{
        head="欢迎投稿"; 
    }
}
void getlx(){
    if(h==-2){
        lx="封禁用户";
    }else if(h==0){
        lx="管理员";
    }else{
        lx="普通用户"; 
    }
}
void gettop(){

}
void geto(){

}
int main(){
    kn[0][0]="柯朵丽";kn[0][1]="代词使用她";
    kn[1][0]="qwq";kn[1][1]="代词使用它";
    kn[2][0]="ewe";kn[2][1]="Aya";
    kn[3][0]="流毒";kn[3][1]="AK IOI!!!";
    kn[4][0]="dog";kn[4][1]="IOI AK ME!!!";
    kn[5][0]="蒟蒻";kn[5][1]="可爱";
    kn[6][0]="蒻";kn[6][1]="毒瘤";
    srand(time(0));
    head=name="欢迎投稿";
    getguzhi();
    getnamecolor();
    gettag();
    getname();
    gethead();
    getlx();
    gettop();
    geto();
    printf("你的总估值为%d:\n基础信用:%d;\n练习情况:%d;\n比赛情况:%d;\n社区贡献:%d;\n获得成就:%d;\n",a+b+c+d+e,a,b,c,d,e);
    cout<<"你的姓名颜色为:"<<(h==-1?"棕名":(h==0?"紫名":(h==1?"灰名":(h==2?"蓝名":(h==3?"绿名":(h==4?"橙名":"红名"))))))<<";"<<endl; 
    if(s=="暂无标签"){
        cout<<s<<";"<<endl;
    }else{
        cout<<"你的标签为:"<<"\""<<s<<"\";"<<endl;
    }
    cout<<"你的用户类型为"<<lx<<";"<<endl; 
    cout<<"你的名字为:"<<name<<";"<<endl;
    cout<<"你的头像为:"<<head<<";"<<endl;
    cout<<"你的排名为:"<</*top*/"欢迎投稿"<<";"<<endl;
    cout<<"你的等级分为:"<</*o*/"欢迎投稿"<<"。"<<endl;
    cout<<"欢迎投稿!!!"<<endl; 
    return 0;

}