对pei学习笔记

我现在才开始整理这个不算晚吧......

望轻喷

学习博客

我们需要四个程序

1.暴力

2.“正解”

3.数据生成器

4.检查程序

暴力:

就是暴力

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 > input.txt
biaoda < input.txt > biaoda_output.txt
test < input.txt > test_output.txt
fc biaoda_output.txt test_output.txt
if not errorlevel 1 goto again
pause

谢谢收看,祝身体健康!

全部评论

相关推荐

程序员小白条:vibe你只要能cover住面试官问你很多深入的实现和选型方案的原因,以及怎么去检测优化效果的就行了
点赞 评论 收藏
分享
04-15 09:59
门头沟学院 C++
yy_11:小公司人家没必要泄密,大公司都是本地部署了
你想吐槽公司的哪些规定
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务