fork download
  1. #include <iostream>
  2. #include <string>
  3. #include <cstdlib>
  4. #include <windows.h>
  5. #include <algorithm>
  6.  
  7. using namespace std;
  8.  
  9. int main() {
  10.  
  11. SetConsoleCP(1251);
  12. SetConsoleOutputCP(1251);
  13.  
  14. istream_iterator<char> input(cin), eof;
  15.  
  16. bool has = false;
  17. char prev = '!';
  18.  
  19. auto check = [&has, &prev](char ch)
  20. {
  21. if (ch == '!') cin.clear(ios::eofbit);
  22. has |= ((prev == 'н' && ch == 'о') || (prev == 'о' && ch == 'н'));
  23. prev = ch;
  24. };
  25.  
  26. for_each(input, eof, check);
  27.  
  28. cout << (has ? "WIN!" : "FAIL!") << endl;
  29. }
  30.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Ты хуй! он нет
compilation info
prog.cpp:4:21: fatal error: windows.h: No such file or directory
 #include <windows.h>
                     ^
compilation terminated.
stdout
Standard output is empty