当前位置:网站首页>/*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;
}
边栏推荐
- Four characteristics and isolation levels of database transactions
- Linked list operation can never change without its roots
- Button wizard business running learning - commodity quantity, price reminder, judgment Backpack
- 【FAQ】华为帐号服务报错 907135701的常见原因总结和解决方法
- leetcode1229. Schedule the meeting
- Some summaries of the third anniversary of joining Ping An in China
- Tables in the thesis of latex learning
- 使用 C# 提取 PDF 文件中的所有文字(支持 .NET Core)
- BGP ---- border gateway routing protocol ----- basic experiment
- From programmers to large-scale distributed architects, where are you (2)
猜你喜欢
随机推荐
Rhcsa operation
leetcode729. My schedule 1
PHP代码审计3—系统重装漏洞
View CSDN personal resource download details
入职中国平安三周年的一些总结
Ruby time format conversion strftime MS matching format
Basic principle of servlet and application of common API methods
system design
原生div具有编辑能力
RHCE - day one
DCL statement of MySQL Foundation
今日睡眠质量记录78分
leetcode1-3
Today's sleep quality record 78 points
基于线性函数近似的安全强化学习 Safe RL with Linear Function Approximation 翻译 2
Button wizard business running learning - commodity quantity, price reminder, judgment Backpack
uniapp 处理过去时间对比现在时间的时间差 如刚刚、几分钟前,几小时前,几个月前
Custom type: structure, enumeration, union
Whether a person is reliable or not, closed loop is very important
Hlk-w801wifi connection








