Skip to content

Instantly share code, notes, and snippets.

@maksadbek
Created October 5, 2013 13:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maksadbek/6841118 to your computer and use it in GitHub Desktop.
Save maksadbek/6841118 to your computer and use it in GitHub Desktop.
#include "iostream"
#include "vector"
using namespace std;
int main(){
int input;
int inputs;
bool existence = false;
vector<int> values;
cin>>input;
while(cin>>inputs){
values.push_back(inputs);
};
for(int i=0; i<values.size(); i++){
if(input == values[i]){
existence = true;
break;
}
}
if(existence)
cout<<"exist"<<endl;
else
cout<<"not exist"<<endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment