C++入门
来源:互联网 发布:筑业市政软件 编辑:程序博客网 时间:2024/06/05 15:46
对拍
先得掌握对拍本领
经常要和题解了对拍
#include<bits/stdc++.h>using namespace std;void print(void){ ofstream fout("in.txt"); #define cout fout // print #undef cout}char ans[300300], wa[300300];int cnt1, cnt2;bool judge(void){ cnt1 = cnt2 = 0; ifstream fin1("wa.txt"), fin2("ans.txt"); while (fin1>>ans[cnt1++]); while (fin2>>wa[cnt2++]); for (int i = 0; i <= cnt2; i++) { if(ans[i] != wa[i]) return 0; } return 1; fin1.close(),fin2.close();}int main(){ ios::sync_with_stdio(0), cin.tie(0); srand(time(0)); for (int i = 1; i <= 10000; i++) { cout<<"case "<<i<<endl; print(); //int S = clock(); system("ans.exe"); //cout<<"ans :"<<clock() - S<<endl; //S = clock(); system("wa.exe"); //cout<<"wa :"<<clock() - S<<endl; if(judge()) cout<<"This case is ok\n"; else goto E; } cout<<"OK!!!"<<endl; return 0;E: cout<<"Oh,no!"<<endl; system("pause");}
1 0
- 入门C
- c 入门
- C入门
- C++/C程序设计入门
- 【c/c++】Vector入门
- C语言入门-指针入门
- C入门:C调用DLL
- 【编程 C】入门C小结
- DataGrid入门经典(C#)
- AJAX入门(C#)
- c语言入门
- C 规则表达式入门
- C语言入门手册
- Unix c 入门指导
- c程序员入门导引
- C语言入门
- C 规则表达式入门
- Objective-C入门
- ANT 学习
- JavaScript之预编译
- SunlightDB 无限扩展
- Thymeleaf教程(二)应用
- Vue环境安装
- C++入门
- 二叉树8:寻找错误结点练习题
- 3D引擎的基础数学知识
- 解决qt Creator更改UI界面后,运行无效果(linux下亲测)
- Selenium报错Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms
- HDU-3578-双塔dp
- iOS 给 label 添加点击事件
- 二叉树9:树上最远距离练习题
- Java继承_常见问题(七)终篇