zoukankan      html  css  js  c++  java
  • 题目编号生成器

    【程序描述】

    利用C++随机函数编写了此程序,用于神犇们在各种OI网站上灵活地攻坚克难,检验他们自己的超高水平。

    【操作描述】

    F11。

    【结果描述】

    一个洛谷(www.luogu.org)网站中题目的ID编号(可能无此题,请尝试新的输出)。

    源代码:
    
    #include<cstdio>
    #include<cstdlib>
    #include<ctime>
    using namespace std;
    int main()
    {
        printf("< Copyright by X-Axis >
    
    ");
        printf("Just a reminder:
        This is for your reference only.
    
    
    ");
        printf("Luogu ID : ");
        srand(time(0));
        int t;
        while (1)
        {
              t=rand()%10;
              if (t<3&&t)
              {
                    printf("%d",t);
                    break;
              }
        }
        if (t==2)
        {
              printf("%d",rand()%7);
              t=rand()%10;
              printf("%d",t);
              if (t==9)
                printf("0");
              else
                printf("%d",rand()%10);
        }
        else
          for (int a=0;a<3;a++)
              printf("%d",rand()%10);
        printf("
    
    ");
        return 0;
    }

     

    一个CodeVS(www.codevs.cn)网站中题目的ID编号(可能无此题,请重试新的输出)。

    源代码:
    
    #include<cstdio>
    #include<cstdlib>
    #include<ctime>
    using namespace std;
    int main()
    {
        printf("< Copyright by X-Axis >
    
    ");
        printf("Just a reminder:
        This is for your reference only.
    
    
    ");
        printf("CodeVS Problem ID : ");
        srand(time(0));
        while (1)
        {
              int t=rand()%10;
              if (t<5&&t)
              {
                    printf("%d",t);
                    break;
              }
        }
        for (int a=0;a<3;a++)
          printf("%d",rand()%10);
        printf("
    
    ");
        return 0;
    }
  • 相关阅读:
    topcoder srm 320 div1
    topcoder srm 325 div1
    topcoder srm 330 div1
    topcoder srm 335 div1
    topcoder srm 340 div1
    topcoder srm 300 div1
    topcoder srm 305 div1
    topcoder srm 310 div1
    topcoder srm 315 div1
    如何统计iOS产品不同渠道的下载量?
  • 原文地址:https://www.cnblogs.com/Ackermann/p/5578059.html
Copyright © 2011-2022 走看看