对拍模板

对拍模板

将文件放在一个文件夹,执行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); 
    }
}
posted @ 2018-02-24 10:36 Menteur_Hxy 阅读( ...) 评论( ...) 编辑 收藏
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值