spj
查看原帖
spj
300025
WaReTle楼主2022/3/5 16:52
#include "testlib.h"
int main(int argc, char* argv[])
{
    registerTestlibCmd(argc, argv);
    int wrong1=0,wrong2=0,cnt=0;
    while(!ans.eof())
	{
		++cnt;
        int pans1=ouf.readInt();
        ouf.readSpace();
        int pans2=ouf.readInt();
        int jans1=ans.readInt();
        ans.readSpace();
        int jans2=ans.readInt();
        ans.readEoln();
        ouf.readEoln();
		if(pans1!=jans1)
			wrong1=cnt;
		if(pans2!=jans2)
			wrong2=cnt;
    }
    if(!wrong1&&!wrong2)
    	quitf(_ok,"The answer is correct");
    else
    	if(wrong1&&wrong2)
    		quitf(_wa,"Dmax is wrong on line %d and X is wrong on line %d",wrong1,wrong2);
    	else
    		if(wrong1)
    			quitp(0.7,"Dmax is wrong on line %d",wrong1);
    		else
    			quitp(0.3,"X is wrong on line %d",wrong2);
    return 0;

}

有可能能用(

2022/3/5 16:52
加载中...