当前位置:网站首页>/*Rewrite the program, find the value of the element, and return the iterator 9.13: pointing to the found element. Make sure that the program works correctly when the element you are looking for does
/*Rewrite the program, find the value of the element, and return the iterator 9.13: pointing to the found element. Make sure that the program works correctly when the element you are looking for does
2022-07-04 10:26:00 【qq_ fifty-eight million seven hundred and thirty-six thousand t】
vector<int>::iterator &fun(vector<int>::iterator &count, int &n)
{
for (count;; count++)
{
if (*count == n)
return count;
else
{
*count = 0;
return count;
}
}
}
int main(void)
{
vector<int> count;
int num, num1;
cout << " Please enter container element " << endl;
while (cin >> num)
count.push_back(num);
cin.ignore();
cin.clear();
cout << " Please enter the value of the element you want to find " << endl;
cin >> num1;
vector<int>::iterator it = count.begin();
vector<int>::iterator a=fun(it, num1);
if (*a!=0 )
cout << " Data found ";
else
cout << " No data found ";
return 0;
}
边栏推荐
- Exercise 9-5 address book sorting (20 points)
- 2020-03-28
- 六月份阶段性大总结之Doris/Clickhouse/Hudi一网打尽
- Velodyne configuration command
- Dos:disk operating system, including core startup program and command program
- C language - stack
- Time complexity and space complexity
- If the uniapp is less than 1000, it will be displayed according to the original number. If the number exceeds 1000, it will be converted into 10w+ 1.3k+ display
- Es entry series - 6 document relevance and sorting
- Summary of several job scheduling problems
猜你喜欢
【Day2】 convolutional-neural-networks
183 sets of free resume templates to help everyone find a good job
The bamboo shadow sweeps the steps, the dust does not move, and the moon passes through the marsh without trace -- in-depth understanding of the pointer
基于线性函数近似的安全强化学习 Safe RL with Linear Function Approximation 翻译 1
Recursion and divide and conquer strategy
From programmers to large-scale distributed architects, where are you (I)
C language structure to realize simple address book
2. Data type
DDL statement of MySQL Foundation
How can Huawei online match improve the success rate of player matching
随机推荐
[FAQ] summary of common causes and solutions of Huawei account service error 907135701
MPLS: multi protocol label switching
If you don't know these four caching modes, dare you say you understand caching?
system design
Es advanced series - 1 JVM memory allocation
The future education examination system cannot answer questions, and there is no response after clicking on the options, and the answers will not be recorded
原生div具有编辑能力
什么是 DevSecOps?2022 年的定义、流程、框架和最佳实践
Exercise 7-4 find out the elements that are not common to two arrays (20 points)
How can Huawei online match improve the success rate of player matching
Basic data types of MySQL
OSPF comprehensive experiment
按键精灵打怪学习-识别所在地图、跑图、进入帮派识别NPC
【Day1】 deep-learning-basics
DCL statement of MySQL Foundation
Hands on deep learning (42) -- bi-directional recurrent neural network (BI RNN)
RHCE day 3
What is devsecops? Definitions, processes, frameworks and best practices for 2022
Kotlin set operation summary
Legion is a network penetration tool