当前位置:网站首页>Write a program to judge whether the elements contained in a vector < int> container are 9.20: exactly the same as those in a list < int> container.
Write a program to judge whether the elements contained in a vector < int> container are 9.20: exactly the same as those in a list < int> container.
2022-07-04 10:26:00 【qq_ fifty-eight million seven hundred and thirty-six thousand t】
#include<iostream>
#include<list>
#include<vector>
using namespace std;
int main(void)
{
vector<int> vc; int value;
list<int> ls;
cout << " Please enter vector Container elements by ctrl+z sign out " << endl;
while (cin >> value)
vc.push_back(value);
cin.ignore();
cin.clear();
cout << " Please enter list Container elements by ctrl+z sign out " << endl;
while (cin >> value)
ls.push_back(value);
vector<int>::iterator iter1 = vc.begin();
list<int>::iterator iter2 = ls.begin();
if (vc.size() == ls.size())
{
while (*iter1++ == *iter2++)
{
if (iter1 == vc.end() && iter2 == ls.end())
{
cout << " The elements of the two containers are exactly the same " << endl;
break;
}
}
}
if (vc.size() != ls.size())
cout << " The elements of the two containers are different " << endl;
return 0;
边栏推荐
猜你喜欢

Development guidance document of CMDB

Advanced technology management - how to design and follow up the performance of students at different levels

Basic data types of MySQL
如果不知道這4種緩存模式,敢說懂緩存嗎?

Architecture introduction
![[FAQ] summary of common causes and solutions of Huawei account service error 907135701](/img/73/c4ee842475f05e2e67297fcac68779.png)
[FAQ] summary of common causes and solutions of Huawei account service error 907135701

When I forget how to write SQL, I

【Day1】 deep-learning-basics

PHP代码审计3—系统重装漏洞

system design
随机推荐
Realsense of d435i, d435, d415, t265_ Matching and installation of viewer environment
From programmers to large-scale distributed architects, where are you (I)
用数据告诉你高考最难的省份是哪里!
OSPF summary
Introduction to tree and binary tree
六月份阶段性大总结之Doris/Clickhouse/Hudi一网打尽
Pod management
Batch distribution of SSH keys and batch execution of ansible
Dynamic memory management
Machine learning -- neural network (IV): BP neural network
Sword finger offer 05 (implemented in C language)
Summary of several job scheduling problems
【OpenCV 例程200篇】218. 多行倾斜文字水印
View CSDN personal resource download details
入职中国平安三周年的一些总结
Delayed message center design
RHCE day 3
OSPF comprehensive experiment
System.currentTimeMillis() 和 System.nanoTime() 哪个更快?别用错了!
Rhsca day 11 operation