fork download
  1. program main;
  2. const alpha=['А'..'Я', 'а'..'п', 'р'..'я'];
  3. const chars=['.', ',', '-', ':', ';', '?',
  4. '!', '"'];
  5. type SoC=set of char;
  6. var i: Integer;
  7. w: string;
  8. c: char;
  9. first: SoC;
  10.  
  11. {Получение множества букв заданного слова}
  12. procedure GetChars(s: string; var m: SoC);
  13. var i: Integer;
  14. begin
  15. for i:=1 to length(s) do
  16. if s[i] in alpha then
  17. include(m, s[i]);
  18. end;
  19.  
  20. begin
  21. assign(input, 'input.txt');
  22. reset(input);
  23. assign(output, 'output.txt');
  24. rewrite(output);
  25.  
  26. while not eof(input) do begin
  27. read(input, c); {Читаем один символ}
  28. if c in alpha then begin
  29. w:='';
  30. {Составляем слово}
  31. while (c in alpha) and (not eof(input)) do begin
  32. w:=w+c;
  33. write(output, c);
  34. read(input, c);
  35. end;
  36. end
  37. else
  38. write(output, c); {Записываем неалфавитный символ}
  39. {if w<>'' then
  40.   write(output, '(', w, ') '); {Выводим слово в скобочках}
  41. end;
  42.  
  43. close(input);
  44. close(output);
  45. end.
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Free Pascal Compiler version 2.2.0 [2009/11/16] for i386
Copyright (c) 1993-2007 by Florian Klaempfl
Target OS: Linux for i386
Compiling prog.pas
prog.pas(2,24) Error: Ordinal expression expected
prog.pas(16,9) Error: Incompatible types: got "Char" expected "Byte"
prog.pas(28,8) Error: Incompatible types: got "Char" expected "Byte"
prog.pas(31,14) Error: Incompatible types: got "Char" expected "Byte"
prog.pas(40,36) Warning: Comment level 2 found
prog.pas(45,4) Fatal: Unexpected end of file
Fatal: Compilation aborted
Error: /usr/bin/ppc386 returned an error exitcode (normal if you did not specify a source file to be compiled)
stdout
Standard output is empty