当前位置:网站首页>/*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 7-3 store the numbers in the array in reverse order (20 points)
- Basic data types of MySQL
- uniapp 小于1000 按原数字显示 超过1000 数字换算成10w+ 1.3k+ 显示
- Some summaries of the third anniversary of joining Ping An in China
- System. Currenttimemillis() and system Nanotime (), which is faster? Don't use it wrong!
- RHCE day 3
- Sword finger offer 05 (implemented in C language)
- 按键精灵跑商学习-商品数量、价格提醒、判断背包
- 入职中国平安三周年的一些总结
- Deep learning 500 questions
猜你喜欢
Advanced technology management - how to design and follow up the performance of students at different levels
C language structure to realize simple address book
Use the data to tell you where is the most difficult province for the college entrance examination!
Custom type: structure, enumeration, union
Development guidance document of CMDB
MongoDB数据日期显示相差8小时 原因和解决方案
Dynamic address book
Four characteristics and isolation levels of database transactions
leetcode842. Split the array into Fibonacci sequences
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
随机推荐
DML statement of MySQL Foundation
Exercise 8-7 string sorting (20 points)
使用 C# 提取 PDF 文件中的所有文字(支持 .NET Core)
Online troubleshooting
Lavel document reading notes -how to use @auth and @guest directives in lavel
How can Huawei online match improve the success rate of player matching
Summary of several job scheduling problems
[200 opencv routines] 218 Multi line italic text watermark
Velodyne configuration command
Exercise 9-5 address book sorting (20 points)
leetcode1-3
Kotlin set operation summary
【Day2】 convolutional-neural-networks
Remove linked list elements
Basic data types of MySQL
PHP code audit 3 - system reload vulnerability
转载:等比数列的求和公式,及其推导过程
Devop basic command
Realsense d435 d435i d415 depth camera obtains RGB map, left and right infrared camera map, depth map and IMU data under ROS
基于线性函数近似的安全强化学习 Safe RL with Linear Function Approximation 翻译 2