#include<vector>#include<algorithm>#include<iostream>usingnamespace std;intfun(){
cout <<"please select"<< endl;
cout <<"1 to add data"<< endl;
cout <<"2 to find data"<< endl;
cout <<"3 to display data"<< endl;
cout <<"4 to quit"<< endl;int a;
cin >> a;return a;}intmain(){
vector <int> a;int x;while((x =fun())!=4){if( x ==1){int b;
cin >> b;
a.push_back(b);}elseif( x ==2){
cout <<"please select "<< endl;
cout <<"1 to find number you want to know"<< endl;
cout <<"2 to find number through position"<< endl;int b;
cin >> b;if(b ==1){
cout <<"put in the number"<< endl;int num;
cin >> num;auto c =find( a.begin(), a.end(), num);if( c != a.end()) cout <<"its position is "<< c - a.begin()<< endl;else cout <<"no found"<< endl;}else{
cout <<"size is "<< a.size()<< endl;
cout <<"please enter the number you want to know"<< endl;int i;
cin >> i ;
cout << a[i]<< endl;}}else{for(int i =0; i < a.size(); i ++)
cout << a[i]<<' ';
cout << endl;}}}