fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. const int len =81; // 1
  8.  
  9. char word[len], line[len]: // 2
  10.  
  11. cout << "Введите слово для поиска: ";
  12.  
  13. cin » word;
  14.  
  15. ifstream fin(“text.txt", ios::in || ios::nocreate); // 3
  16.  
  17. if (!fin) { cout << "Ошибка открытия файла." << endl; return 1; ) //4
  18.  
  19. while (fin.getline(line, len)) // 5
  20.  
  21. {
  22.  
  23. if (strstr(line, word)) // 6
  24.  
  25. {
  26.  
  27. cout << "Присутствует!" << endl;
  28.  
  29. return 0;
  30.  
  31. }
  32.  
  33. }
  34.  
  35. cout << "Отсутствует!" << endl;
  36.  
  37. return 0;
  38.  
  39. }
  40. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(9,10): error CS0650: Syntax error, bad array declarator. To declare a managed array the rank specifier precedes the variable's identifier. To declare a fixed size buffer field, use the fixed keyword before the field type
prog.cs(9,21): error CS0650: Syntax error, bad array declarator. To declare a managed array the rank specifier precedes the variable's identifier. To declare a fixed size buffer field, use the fixed keyword before the field type
prog.cs(13,5): error CS1056: Unexpected character `»'
prog.cs(13,7): error CS0128: A local variable named `word' is already defined in this scope
prog.cs(15,12): error CS1525: Unexpected symbol `(', expecting `,', `;', or `='
prog.cs(15,14): error CS1056: Unexpected character `“'
prog.cs(16,0): error CS1010: Newline in constant
prog.cs(17,0): error CS1010: Newline in constant
prog.cs(18,0): error CS1010: Newline in constant
prog.cs(19,0): error CS1010: Newline in constant
prog.cs(20,0): error CS1010: Newline in constant
prog.cs(21,0): error CS1010: Newline in constant
prog.cs(22,0): error CS1010: Newline in constant
prog.cs(23,0): error CS1010: Newline in constant
prog.cs(24,0): error CS1010: Newline in constant
prog.cs(25,0): error CS1010: Newline in constant
prog.cs(26,0): error CS1010: Newline in constant
prog.cs(27,0): error CS1010: Newline in constant
prog.cs(28,0): error CS1010: Newline in constant
prog.cs(29,0): error CS1010: Newline in constant
prog.cs(30,0): error CS1010: Newline in constant
prog.cs(31,0): error CS1010: Newline in constant
prog.cs(32,0): error CS1010: Newline in constant
prog.cs(33,0): error CS1010: Newline in constant
prog.cs(34,0): error CS1010: Newline in constant
prog.cs(35,0): error CS1010: Newline in constant
prog.cs(36,0): error CS1010: Newline in constant
prog.cs(37,0): error CS1010: Newline in constant
prog.cs(38,0): error CS1010: Newline in constant
prog.cs(39,0): error CS1010: Newline in constant
prog.cs(40,0): error CS1010: Newline in constant
prog.cs(40,2): error CS1039: Unterminated string literal
prog.cs(40,2): error CS8025: Parsing error
Compilation failed: 33 error(s), 0 warnings
stdout
Standard output is empty