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