自动造句机

· · 个人记录

支持针对性修改,提供模板,需要的内容自行添加

#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
long long A=36,BB=10,CC=10,DD,E,ASK,N,M,n,m,p,B,D,K[10],Wait=5,fnd,P,W=5,x,y=7;
vector<long long> a,b;
string s;
string s1[36]={
"markkkk","daipengfeng_jv_ruo","sunhaoyu403",
"chenyuan3","hyc42","kkksc03",
"advanced_lazy_cancer","CodingCoderOrz2020","_theHavenTrials_",
"noip","Miracle_InDream","CCF",
"CSP-J","CSP-S","NOI",
"NOIP","IOI","CCPC",
"ICPC","NBA","CBA",
"SB","qinshihuang","beijixiong",
"caijiuduolian","dream","ruji",
"sksksksk","xianduanshu","hongheishu",
"luogu","Codeforces","Atcoder",
"xyd","HuoZhixin","Neo1031"};
string s2[10]={"'s mother ","'s OJ ","'s fumu ","'s npy ","'s friend "," "," "," "," "," "};
string s3[10]={
"ride","AK","JC","C","ctj",
"kills","eats","bao0","'zanmei'","is"};
void c(int x)
{
    SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),x);
}
void C(int x,int y)
{
    SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),x|y<<4);
}
void say(string s)
{
    for(int i=0;i<s.size();++i)
    {
        cout<<s[i];
        Sleep(Wait);
    }
}
long long r()
{
    ++n;
    long long x=1;
    for(long long i=1;i<=rand()%4+1;++i)
      x=x*B%M;
    x=x*rand()%M;
    if(n%1000000==0)
      printf("%12lld ",x);
    if(n%10000000==0)
      puts("");
    if(n%10000==0)
      B=(((rand()*rand()%M)*rand()%M)*rand()%M)*rand()%M;
    return x;
}
int main()
{
    while(1)
    {
        system("cls");
        say("putin two numbers to change the color or putin -1 -1 to break this:\n");
        say("(putin) (Background)     (Foreground)\n");
        for(int i=0;i<16;++i)
        {
            C(y,x);
            if(i>9)
              cout<<"  ";else
              cout<<"   ";
            cout<<i;
            if(i<10)
              C(y,x),cout<<"       ";else
              cout<<"("<<char(i+55)<<")",C(y,x),cout<<"    ";
            C(y,i);
            if(i<10)
              cout<<i<<i;else
              cout<<char(i+55)<<char(i+55);
            C(y,x);
            cout<<"              ";
            C(i,x);
            if(i<10)
              cout<<i<<i;else
              cout<<char(i+55)<<char(i+55);
            cout<<'\n';
        }
        C(y,x);
        cin>>x>>y;
        if(x==-1&&y==-1)
          break;
        C(y,x);
    }
    srand(time(0));
    while(1)
    {
        system("cls");
        say("Find A Number...\n");
        say("\nA finds 111111111 222222222....\n");
        say("B finds what you putin\n");
        say("C rand to make something\n");
        cin>>s;
        if(s=="A")
        {
            system("cls");
            cout<<"MAX( < ) ";
            cin>>M;
            cout<<"N=";
            cin>>N;
            n=m=0;
            a.clear();
            b.clear();
            B=rand();
            while(n<=N)
            {
                p=r();
                memset(K,0,sizeof(K));
                for(long long i=1;p>=i&&i<=1000000000;i*=10)
                  if((++K[p/i%10])>8)
                  {
                    ++m;
                    a.push_back(n),b.push_back(p);
                    cout<<"\nfound the number "<<p<<" at the "<<n<<"th time\n";
                  }
            }
            cout<<"found "<<m<<" times in total\nthey are ";
            for(long long i=0;i<m;++i)
            {
              cout<<a[i]<<" th   (   "<<b[i]<<"   )            ";
              if(i%3==2)
                cout<<'\n';
            }
            cout<<'\n';
        }
        if(s=="B")
        {
            system("cls");
            cout<<"MAX( < ) ";
            cin>>M;
            cout<<"N=";
            cin>>N;
            cout<<"ask the number:";
            cin>>fnd;
            n=0;
            B=rand();
            while(n<=N)
            {
                ++n;
                if(r()==fnd)
                {
                    cout<<"found the number:  "<<fnd<<"  at the "<<n<<"th time\n";
                    Sleep(1500);
                }
            }
        }
        if(s=="C")
        {
            while(1)
            {
                say("putin some small letters to work or putin -1 to break\n");
                cin>>s;
                if(s=="-1")
                  break;
                int A1=rand()%A,A2=rand()%BB,A3=rand()%CC,A4=rand()%A,A5=rand()%BB;
                cout<<s1[A1]<<s2[A2]<<s3[A3]<<' '<<s1[A4]<<s2[A5]<<'\n';
                Sleep(200);
            }
        }
    }
}