特別鳴謝Reddest大爺對博主的大♂力幫助。原文做者Reddest,故本篇blog不對代碼作任何特別解釋,想看講解的看官老爺們能夠移步Reddest大爺原文,連接→_→對拍程序講解及源碼舉例——Reddest(不過背景很辣眼睛就是了_(:з」∠)_html
數據生成器:windows
1 #include <stdio.h> 2 #include <ctime> 3 #include <cstdlib> 4 using namespace std; 5 int main() 6 { 7 srand(time(0)); 8 int a,b; 9 a=rand();b=rand(); 10 printf("%d %d",a,b); 11 return 0; 12 }
對拍:ide
1 #include <stdio.h> 2 #include <windows.h> 3 using namespace std; 4 int main() 5 { 6 int t=100; 7 while(t--) 8 { 9 system("data>Input.in"); 10 system("force<Input.in>force.out"); 11 system("std<Input.in>std.out"); 12 if(system("fc force.out std.out")) break; 13 } 14 system("pause"); 15 return 0; 16 }
弱弱地說一句,本蒟蒻碼字也不容易,轉載請註明出處http://www.cnblogs.com/Maki-Nishikino/p/6003017.htmlspa