当前位置:网站首页>/*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;
}
边栏推荐
- Whether a person is reliable or not, closed loop is very important
- Hands on deep learning (45) -- bundle search
- How to teach yourself to learn programming
- Vanishing numbers
- 使用 C# 提取 PDF 文件中的所有文字(支持 .NET Core)
- Introduction to tree and binary tree
- Velodyne configuration command
- Kotlin: collection use
- 7-17 crawling worms (15 points)
- 六月份阶段性大总结之Doris/Clickhouse/Hudi一网打尽
猜你喜欢
Doris / Clickhouse / Hudi, a phased summary in June
【Day1】 deep-learning-basics
Safety reinforcement learning based on linear function approximation safe RL with linear function approximation translation 2
Three schemes of ZK double machine room
Rhcsa - day 13
Some summaries of the third anniversary of joining Ping An in China
C language structure to realize simple address book
Advanced technology management - how to design and follow up the performance of students at different levels
How can Huawei online match improve the success rate of player matching
PHP代码审计3—系统重装漏洞
随机推荐
Use the data to tell you where is the most difficult province for the college entrance examination!
Remove linked list elements
转载:等比数列的求和公式,及其推导过程
5g/4g wireless networking scheme for brand chain stores
Map container
[200 opencv routines] 218 Multi line italic text watermark
DCL statement of MySQL Foundation
RHCE - day one
MPLS: multi protocol label switching
7-17 crawling worms (15 points)
leetcode1-3
【Day2】 convolutional-neural-networks
什么是 DevSecOps?2022 年的定义、流程、框架和最佳实践
Es advanced series - 1 JVM memory allocation
The time difference between the past time and the present time of uniapp processing, such as just, a few minutes ago, a few hours ago, a few months ago
AUTOSAR from getting started to mastering 100 lectures (106) - SOA in domain controllers
C language structure to realize simple address book
What is devsecops? Definitions, processes, frameworks and best practices for 2022
Occasional pit compiled by idea
Rhcsa - day 13