⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 noi_debug.txt

📁 程序测试机
💻 TXT
字号:
program debug;
{ver 0.1}
{made by jjh}
{$M 16300,0,0} 

uses Dos; 

var
fin,fout:text;
s,sin1,sin2,sout1,sout2,sin,sout,exe:string;
n:integer; 

procedure start;
  begin
  writeln;
  writeln('                       ---   ANSWER CHECK SYSTEM   ---');
  writeln('                         ---    made by XT3000   ---');
  writeln('                            ---    VER  0.1   ---');
  writeln;
  end; 

procedure ready;
  var
  i,j,k:longint;
  begin
  writeln('Please input your EXE program path:(full path)');
  readln(exe);
  writeln('please input your program`s INPUT file path:(full name)');
  readln(sin);
  writeln('please input your program`s OUTPUT file path:(full name)');
  readln(sout);
  writeln('Please input the NUMBER of your test dates:');
  readln(n);
  writeln('Please input the format of INPUT TEST DATAs:');
  writeln('(Like : "e:\in#.txt". the "#" means 1,2,3...n .)');
  readln(s);
  j:=pos('#',s);
  if j>0 then
    begin
    sin1:=copy(s,1,j-1);
    sin2:=copy(s,j+1,255);
    end;
  writeln('Please input the format of OUTPUT TEST DATAs:(Just like the INPUT`s format)');
  readln(s);
  j:=pos('#',s);
  if j>0 then
    begin
    sout1:=copy(s,1,j-1);
    sout2:=copy(s,j+1,255);
    end;
  end;
procedure openexe(Command:string);
  begin
    if Command <> '' then
    begin
      SwapVectors;
      Exec(GetEnv('COMSPEC'), '/C ' + Command);
      SwapVectors;
      if DosError <> 0 then
        WriteLn('Error:Could not execute COMMAND.COM');
    end;
  end; 

procedure text;
  var
  i,j,t:integer;
  s,s1,s2:string;
  err:array[1..20] of byte;
  begin
  for i:=1 to n do
    begin
    openexe('del '+sin);
    str(i,s);
    openexe('copy '+sin1+s+sin2+' '+sin);
    openexe(exe);
    assign(fin,sout1+s+sout2);
    assign(fout,sout);
    reset(fin);reset(fout);
    t:=0;
    while (not Eof(fout)) and (t=0) do
      begin
      readln(fin,s1);readln(fout,s2);
      if s1<>s2 then t:=1;
      end;
    close(fin);close(fout);
    err[i]:=t;
    end;
  openexe('cls');
  writeln('                                --- List ---');
  for i:=1 to n do
    if err[i]=0 then
      writeln('file ',i,' OK!')
    else
      writeln('file ',i,' WRONG!');
  end; 

begin
start;
ready;
text;
readln;
end. 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -