我如今纔開始整理這個不算晚吧......ios
望輕噴c++
學習博客學習
咱們須要四個程序spa
1.暴力.net
2.「正解」code
3.數據生成器blog
4.檢查程序ci
暴力:get
就是暴力input
eg:
#include <cstdio>
#include <iostream> using namespace std; int main() { int a, b; cin >> a >> b; cout << a + b << endl; return 0; }
正解:
你以爲挺對的程序
#include <cstdio>
#include <iostream> int main() { int a, b; scanf("%d %d",&a, &b); printf("%d\n", a + b); return 0; }
隨機數:
#include <bits/stdc++.h>
using namespace std;
int main()
{
srand(time(0));
int a,b;
a=rand()%100+1,b=rand()%100+1;
printf("%d %d\n",a,b);
return 0;
}
檢查程序:
checker.bat
:again data.exe > input.txt biaoda.exe < input.txt > biaoda_output.txt test.exe < input.txt > test_output.txt fc biaoda_output.txt test_output.txt if not errorlevel 1 goto again pause
謝謝收看,祝身體健康!