自动AC机

可以在lemon和cena环境下使用。

#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
char s[1000];
int main()
{
    int a,b,id,n,m;
    freopen("dream.in","r",stdin);
    freopen("dream.out","w",stdout);
    scanf("%d%d",&n,&m);
    fclose(stdin);
    for (int i=1; i<=20; i++)
        {
            sprintf(s,"..\\..\\data\\dream\\dream%d.in",i);
            freopen(s,"r",stdin);
            scanf("%d%d",&a,&b);
            if (a==n&&b==m)
                {
                    id=i;
                    break;
                }
            fclose(stdin);
        }
//  cout<<id<<endl;
    sprintf(s,"..\\..\\data\\dream\\dream%d.out",id);
    freopen(s,"r",stdin);
    char ans;
    while(~scanf("%c",&ans))
        printf("%c",ans);
    return 0;
}

猜你喜欢

转载自www.cnblogs.com/autoint/p/9593292.html
今日推荐