fork download
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4.  
  5.  
  6. int main() {
  7.  
  8. ios_base::sync_with_stdio(false);
  9. cin.tie(NULL);
  10.  
  11. int n, szukana;
  12. cin >> n;
  13.  
  14. vector<int> ted(n);
  15.  
  16. for (int i = 0; i < ted.size(); i++) {
  17. cin >> ted[i];
  18. }
  19.  
  20. cin >> szukana;
  21.  
  22. int i = 0;
  23.  
  24. while (i < ted.size() && ted[i] != szukana) {
  25. i++;
  26. }
  27.  
  28. if (i < ted.size()) {
  29. cout << "Mamy to!";
  30. } else {
  31. cout << "Ciemnosc widze!";
  32. }
  33.  
  34. return 0;
  35. }
Success #stdin #stdout 0s 5308KB
stdin
5
3 -7 12 0 5
12
stdout
Mamy to!