c++prime 练习 11.12
来源:互联网 发布:编程语言难易排名 编辑:程序博客网 时间:2024/06/05 15:26
/*编写程序,读入string和int序列,将每个string和int存入一个pair中,pair保存在一个vector中。*/#include<iostream>#include<string>#include<fstream>#include<vector>#include<utility>int main(int argc,char *argv[]){using namespace std;ifstream in1(argv[1]),in2(argv[2]);if(!in1){cout<<"Can't open the file: "<<argv[1];exit(1);}if(!in2){cout<<"Can't open the file: "<<argv[2];exit(1);}vector<pair<string,int>> v1;string str_temp;intint_temp;while(in1>>str_temp&&in2>>int_temp){v1.push_back(make_pair(str_temp,int_temp));}for(const auto &p:v1){cout<<p.first<<' '<<p.second<<endl;}system("pause");}
0 0
- c++prime 练习 11.12
- C++prime
- C & Prime
- c++prime
- C语言练习11.12
- c++prime笔记一
- C++Prime读书笔记4
- 432 C. Prime Swaps
- vector《c++prime》
- 2013寒假练习 1054 Largest prime factor
- 练习赛8.1Prime Ring Problem
- Project Ruler 算法练习之 Truncate Prime
- 练习二 1020 Prime Ring Problem
- PAT甲级练习1059. Prime Factors (25)
- CF/359/C. Prime Number
- codeforces 432c Prime Swaps
- codeforces 432C Prime Swaps
- Codefoces 432 C. Prime Swaps
- 几种RIA技术(富互联网应用程序)比较
- WebApp之PhoneGap控制器整体下拉上拽
- Spring rmi实现简单例子
- ORA-39700:database must be opened with UPGRADE option
- 网络零售和移动互联网搅动中国网络经济神经
- c++prime 练习 11.12
- JVM学习笔记(三):类的连接
- 常见算法:C语言求最小公倍数和最大公约数三种算法
- Adb&shell相关命令
- Xcode常用快捷键总结
- GCD学习(七) dispatch_apply
- Oracle EBS 如何设置事务处理分配行金额、成本和资源费率等等数字小数点位数?
- 2015 04 03 回归csdn
- laravel开发环境设置