Windows version Portal: http://www.cnblogs.com/shamman/p/7336917.html
Tinkering with a half-day noilinux, is almost to understand, will probably use noilinux brush questions more.
Data generators (as is the case with Windows)
1#include <bits/stdc++.h>2 using namespacestd;3 #defineRandom (A, B) ((a) +rand ()% ((b)-(a) +1))4 5 StringStream SS;6 7 intMainintargcChar*argv[])8 { 9 intSeed=Time (NULL);Ten if(ARGC)//If there are parameters One { A ss.clear (); -ss<<argv[1]; -ss>>seed;//convert parameters to integers to assign to seed the } - Srand (seed); - //The above is a random number initialization, do not modify - //Random (A, B) to generate a [a, b] integer + - //Write your own data below to generate code, write according to test instructions +printf"1\n"); A intn=Ten; at intM=random (1, -); -printf"%d%d\n", n,m); - for(intI=0; I<n; ++i) - { -printf"%d", Random (0, M)); - } inprintf"\ n"); - return 0; to}
The PAT procedure
1#!/bin/Bash2 while true; Do3./rand $RANDOM > Data.txt//Data Generators4./std < Data.txt > Out1.txt//Positive Solution5./my < Data.txt > Out2.txt//you write the correctness of the unknown program6 ifdiff out1.txt Out2.txt;7 Echo AC8 Else9 Echo WATenExit0 One fi ADone
Save the file as an. sh suffix (take test.sh for example), and then put three programs in one directory.
When using the first ctrl+alt+t open the terminal, and then enter the CD your file directory (right-click File properties can see the path, all into the case, all the same, note here to all the English path, otherwise unrecognized), enter.
Then enter SH sh.test, enter.
This time on the shooting began to run, if the output of two programs are not different, you will see a lot of lines AC, detect the difference when the beat will stop, you can see in the terminal two programs output the content, in the directory of the data.in can find the wrong set of data.
Pat is still very practical, suggest back down, to the examination room and other passwords when you can first knock out, each problem first write violence and then think positive solution, and then take a shot on the stable more.
Linux next to the beat template