fc.cpp

· · 个人记录

防止大样例抽风,不知道这个写法行不行 / 有没有更好的写法

upd:KHIN 说的对,改成 strcmp 了,原先没听说过这个函数()

char s[1000010],t[1000010];
signed main(){
    FILE *fo=fopen("data.out","r");
    FILE *fa=fopen("data.ans","r");
    while(fscanf(fo,"%s",s)!=EOF){
        if(fscanf(fa,"%s",t)==EOF){
            puts("WA");
            return 0;
        }
        if(strcmp(s,t)){
            puts("WA");
            return 0;
        }
    }
    if(fscanf(fa,"%s",t)!=EOF)puts("WA");
    else puts("AC");
    return 0;
}