测试 ./programe 输入为 in.txt, 输出到 out.txt,正确答案为 right.txt的情况下的正确性。如果正确的话,输出Accept,否则输出Wrong Answer。
注意:一个程序是正确的当且仅当它的输出与标准输出完全一致或它的输出比标准输出的结尾多或少一个换行符(’ \n ‘ )
#include <stdio.h>、
#include <string.h>
#include "run.h"
int main()
{
const char *name_program = "./program";
const char *name_in = "./in.txt";
const char *name_out = "./out.txt";
const char *name_right = "./right.txt";
run(name_program, name_in, name_out);
FILE *fpright = fopen(name_right, "r");
FILE *fpout = fopen(name_out, "r");
char c1[5000], c2[5000];
int out = 0, right = 0;
char a;
while( ~fscanf(fpout, "%c", &a))
{
c1[out++] = a;
}
c1[ou