fork download
  1. program main;
  2. const nmax=15;
  3. type TArr=array[1..nmax] of string;
  4. var A:TArr;
  5. s: string;
  6. i: Integer;
  7.  
  8. procedure split(s: string; var list: TArr);
  9. const letters: set of char=['а'..'п', 'р'..'я', 'А'..'Я'];
  10. var _word: String;
  11. i,n: Integer;
  12. begin
  13. i:=1;
  14. n:=1;
  15. s:=s+ ' ';
  16. while i<length(s) do
  17. if s[i] in letters then begin
  18. _word:='';
  19. while (s[i] in letters) and (i<length(s)) do begin
  20. _word:=_word+s[i];
  21. inc(i);
  22. end;
  23. if _word <> ' ' then begin
  24. list[n]:=_word;
  25. inc(n);
  26. end;
  27. end
  28. else inc(i);
  29. inc(n);
  30. list[n]:=nil;
  31. end;
  32.  
  33. procedure sort(var list: TArr);
  34. var buffer: string;
  35. i,j: Integer;
  36. begin
  37. for i:=1 to nmax-1 do
  38. for j:=i+1 to nmax do
  39. if list[i]>list[i+1] then begin
  40. buffer:=list[i];
  41. list[i]:=list[j];
  42. list[j]:=buffer;
  43. end;
  44. end;
  45.  
  46. begin
  47. read(s);;
  48. split(s, A);
  49. sort(A);
  50. i:=1;
  51. while A[i]<>nil do begin
  52. writeln(A[i]);
  53. inc(i);
  54. end;
  55. 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(9,39) Error: Ordinal expression expected
prog.pas(9,64) Error: Illegal expression
prog.pas(30,14) Error: Incompatible types: got "Pointer" expected "ShortString"
prog.pas(51,13) Error: Operator is not overloaded
prog.pas(55,4) Fatal: There were 4 errors compiling module, stopping
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