fork(1) 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. string s;
  15.  
  16. cout << "Введите последовательность символов (первый символ отличен от воскл. знака):" << endl;
  17. cin >> s;
  18.  
  19. int i = s.find('!');
  20.  
  21. s.erase (i);
  22.  
  23. if (i == 0) {
  24. cout << "Первый символ должен быть отличен от восклицательного знака!" << endl;
  25. } else if(s.find("он")!=-1||s.find("но")!=-1) {
  26. cout << "Да, имеются." << endl;
  27. } else {
  28. cout << "Нет, отсутствуют." << endl;
  29. }
  30.  
  31. system("pause");
  32. return 0;
  33. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
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