vector cin
2024-09-07 20:01:06
vector<int>vec1,vec2; int ival; cout<<"Ender numbers for vector1(-1 to end):"<<endl; cin>>ival; while (ival!=-1) { vec1.push_back(ival); cin>>ival; } cout<<"Ender numbers for vector2(-1 to end):"<<endl; cin>>ival; while (ival!=-1) { vec2.push_back(ival); cin>>ival; } if (vec1.size()!=vec2.size()) { cout<<"不相等"<<endl; } else{ vector<int>::iterator ite1,ite2; for (ite1=vec1.begin(),ite2=vec2.begin(); ite1!=vec1.end(),ite2!=vec2.end(); ++ite1,++ite2) { if (*ite1==*ite2) { cout<<"相等"<<endl; } } }
最新文章
- [LeetCode] Populating Next Right Pointers in Each Node II 每个节点的右向指针之二
- iOS 引入framework的常见问题和原理
- 2.多线程-GCD
- hdu 3987 Harry Potter and the Forbidden Forest 求割边最少的最小割
- spring项目中如何添加定时器以及在定时器中自动生成sprng注入对象
- Xcode 6&#160;越狱开发基础
- 【Android】JSONArray的合并
- NGUI类之间的关系和架构
- BZOJ 1211: [HNOI2004]树的计数( 组合数学 )
- Sass与Compress实战:第五章
- 基于Three.js的360度全景--photo-sphere-viewer--简介
- android 获取Bitmap位图所占用的内存大小
- 14.5 富文本编辑【JavaScript高级程序设计第三版】
- BZOJ2333 [SCOI2011]棘手的操作 堆 左偏树 可并堆
- jsfl 将库中声音放置到时间轴上
- [Module] 03 - Software Design and Architecture
- Oracle EBS 键弹性域 段限定词取值
- Spring自动装配Bean详解
- OSX 下 sftp 上传目录到服务器
- 纯css实现点击事件