zoukankan      html  css  js  c++  java
  • 福州小升初摇号程序

    #include<cstdio>

    #include<cstring>
    #include<iostream>
    #include<string>
    #include<algorithm>
    using namespace std;

    #if 0
    //2021 台江华伦
    int canyu=1979;
    int jihua=324;
    int increased=7;
    int first=921;
    #endif

    #if 1
    //2021 时代
    int canyu=3224;
    int jihua=530+5;
    int increased=7;
    int first=2504;
    #endif

    int yaozhong[5000];//摇中
    int main()
    {
        int total=0;
        for(int i=first;i<=canyu;)
        {
            //从i找出第一个每中的人
            if(!yaozhong[i])
            {
                yaozhong[i]=1;
                printf("%d ", i);

                // 增加摇中的总人数,如果超出计划,就说明招满了,退出
                total++;
                if(total==jihua)
                    break;
            }
            i=(i+increased);
            if(i>canyu) i=i-canyu;
        }

        return 0;
    }

  • 相关阅读:
    Git
    Git
    Git
    Git
    Docker
    Linux
    Linux
    Python
    Python
    SQL
  • 原文地址:https://www.cnblogs.com/cute/p/15019682.html
Copyright © 2011-2022 走看看