Teacher yzh's last day of teaching at Qingbei Academy:
Create a folder
Copy the source code you want to shoot in (for example: test.cpp)
Put the brute force code that you have written and be sure to also put in, pay attention to the difference between the two names (for example: test__.cpp)
Make a code to generate data (for example: mkdata.cpp)
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#define For(i,l,r) for(int i=l;i<=r;i++)
int main(){
freopen("coin.in","w",stdout);
srand(time(0));
int n = 1000;
// printf("%d\n",n);
For(i,1,n) printf("%lf %lf\n",(rand()%200+100)/100.0,(rand()%200+100)/100.0);
}
This code can generate n lines with two greater than 1 each,
And high-precision floating-point numbers between 1 and 3
(Master Lao likes to use macro definitions too)
- Finally a bat script
:loop
mkdata
test
test__
fc test.out test__.out
if errorlevel == 1 pause
goto loop
loop means loop, then the .exe you want to open
So note that we must run the code generation .exe first before opening the script.
fc is used for file comparison,
If there is any discrepancy, it will suspend the output of lines, and the reader is requested to implement it.