Advertisement
Guest User

Untitled

a guest
Feb 24th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main(){
  4.  
  5. int arr[100], n,,key,i;
  6.  
  7. cin>>n;
  8.  
  9. for(i=0; i<n; i++)
  10. cin>>arr[i];
  11. cin>>key;
  12.  
  13. for(i=0; i<n; i++)
  14. {
  15. if(arr[i]==key){
  16. cout<<"Yes"<<endl;
  17. break;
  18. }
  19. }
  20.  
  21. if(arr[i]!=key)
  22. cout<<"NO"<<endl;
  23.  
  24. return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement