zoukankan      html  css  js  c++  java
  • 对拍模板

    将文件放在一个文件夹,执行test即可
    creatrand:

    #include<iostream>
    #include<ctime>
    #include<cstdlib>
    using namespace std;
    int n,m,k;
    int main()
    {
        freopen("in.txt","w",stdout);
        srand(time(0));
        n=rand()%60+2;//rand()  0-2^16
        m=rand()%50+3;
        k=rand()%40+1;
        cout<<n<<endl;
        cout<<m<<endl;
        cout<<k<<endl;
    }

    program1:

    #include<iostream>
    #include<cstdio>
    #include<cstring>
    using namespace std;
    long long a,b,c;
    int main()
    {
        freopen("in.txt","r",stdin);
        freopen("1.txt","w",stdout);
        cin>>a>>b>>c;
        if(a>b) swap(a,b);
        if(b>c) swap(b,c);
        if(a>c) swap(a,c);
        cout<<c;
        return 0;
    }

    program2:

    #include <iostream>  
    #include <cstdio>  
    #include <cstring>  
    using namespace std;  
    int a,mx,t;
    int main()  
    {   
        freopen("in.txt","r",stdin);
        freopen("2.txt","w",stdout);
        while(++t<=3)
        {
            scanf("%d",&a);
            if(a>mx)
              mx=a;
            if(mx>50) mx=50;//
        }
        printf("%d",mx);
        return 0;
    }

    test:

    #include<ctime> 
    #include<cstdlib>
    int main()
    {
        int i,j;
        srand(time(0));
        while(1)
        {
            system("CreatRand.exe");
            system("program1.exe");
            system("program2.exe");
            if(system("fc 1.txt 2.txt"))
              while(1); 
        }
    }
    版权声明:本文为博主原创文章,未经博主允许不得转载。 博主:https://www.cnblogs.com/Menteur-Hxy/
  • 相关阅读:
    牢骚
    【题解】LFYZNoip前水题赛 T6
    【模板】 ST表
    【模板】高精度。。。。。
    【模板】堆优化 + dij +pair 存储
    【模板】树状数组
    近两天目标
    当堆遇到STL 代码焕发光芒
    【模板】并查集
    【NOI2000】 单词查找树
  • 原文地址:https://www.cnblogs.com/Menteur-Hxy/p/9248015.html
Copyright © 2011-2022 走看看