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;
    }
  • 相关阅读:
    Django之模板
    Django之视图
    Django之web框架和url路由
    SpringBoot整合Druid数据源
    SpringBoot整合定时任务异步任务
    逐行解读HashMap源码
    SpringBoot通过RedisTemplate执行Lua脚本
    SpringBoot使用H2内嵌数据库
    SpringBoot如何使用拦截器
    SpringBoot热部署的实现方式
  • 原文地址:https://www.cnblogs.com/Ackermann/p/5578059.html
Copyright © 2011-2022 走看看