fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n;
  6. cin>>n;
  7. int a[n]={};
  8. bool find=false;
  9.  
  10. for(int i=0;i<n;i++)
  11. {
  12. cin>>a[i];
  13. }
  14.  
  15. int key=0;
  16. cin>>key;
  17.  
  18. for(int i=0;i<n;i++)
  19. {
  20. if(a[i]==key)
  21. {
  22. find=true;
  23. break;
  24. }
  25. }
  26.  
  27. if(find)
  28. {
  29. cout<<"Congrats";
  30. }
  31. else
  32. {
  33. cout<<"None";
  34. }
  35. return 0;
  36. }
Success #stdin #stdout 0s 5320KB
stdin
5
10110001
10111011
10111112
10158745
10657450
10101113
stdout
None