fork(3) download
  1. program laba2exp2;
  2.  
  3.  
  4. var
  5. a : array[1..200] of char;
  6. c : char;
  7. x, i, size : integer;
  8. test : integer;
  9.  
  10. procedure push(c : char);
  11. begin
  12. size := size + 1;
  13. a[size] := c;
  14. end;
  15.  
  16. procedure pop;
  17. begin
  18. size := size - 1;
  19. end;
  20.  
  21. function top : char;
  22. begin
  23. top := a[size];
  24. end;
  25.  
  26. function Empty : integer;
  27. begin
  28. if size >= 1 then result:=0
  29. else result:=1;
  30. end;
  31.  
  32. Procedure skobki(var c:char); {В юнит}
  33. var d:integer;
  34. begin
  35. d:=Ord(c);
  36. if d = 40 or d = 123 or d = 91 then {Код Аски}
  37. begin
  38. push(c);
  39. laba(c);
  40. end
  41. else srav(c);
  42. end;
  43.  
  44.  
  45. function laba(var c:char):boolean;
  46. begin
  47. Read(c); { Чтение скобки }
  48. test:=Empty;
  49. if c = '.' then if test=1 then result:=false;
  50. skobki(c);
  51. end;
  52.  
  53. function srav(var c:char):boolean;
  54. begin
  55. CASE c of
  56. '(' : begin
  57. if top(c) != ')' then return:=false
  58. else
  59. begin
  60. pop(c);
  61. laba(c);
  62. end;
  63. end;
  64. '{' : begin
  65. if top(c) != '}' then return:=false
  66. else laba(c);
  67. end;
  68. '[' : begin
  69. if top(c) != ']' then return:=false
  70. else laba(c);
  71. end;
  72. end;
  73.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Free Pascal Compiler version 2.6.4+dfsg-4 [2014/10/14] for i386
Copyright (c) 1993-2014 by Florian Klaempfl and others
Target OS: Linux for i386
Compiling prog.pas
prog.pas(28,27) Error: Identifier not found "result"
prog.pas(29,16) Error: Identifier not found "result"
prog.pas(36,7) Error: Incompatible types: got "Boolean" expected "LongInt"
prog.pas(39,11) Error: Identifier not found "laba"
prog.pas(41,12) Error: Identifier not found "srav"
prog.pas(49,40) Error: Identifier not found "result"
prog.pas(57,23) Fatal: illegal character "'!'" ($21)
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