fork download
  1. program Project1;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. uses
  6. {$IFDEF UNIX}{$IFDEF UseCThreads}
  7. cthreads,
  8. {$ENDIF}{$ENDIF}
  9. Classes
  10. { you can add units after this };
  11.  
  12. Function f3(zlicz:string):integer;
  13. var s:integer;
  14. i: integer;
  15. n: char;
  16. k: char;
  17. v: char;
  18. begin
  19. Result:=0; s:=0;
  20. for i:=1 to length(zlicz) do
  21. begin
  22. n:=(zlicz[i]);
  23. k:=(zlicz[i-1]);
  24. v:=(zlicz[i+1]);
  25. if (((n=chr(63)) or (k=chr(33)) or (k=chr(46))) and (k=chr(32)) and
  26. ((v=chr(65)) or (v=chr(69)) or (v=chr(73)) or (v=chr(79)) or
  27. (v=chr(85)) or (v=chr(89)))) then s:=s+1;
  28. Result:=s;
  29. end;
  30. end;
  31.  
  32. Function f5(zlicz:string):integer;
  33. var s:integer;
  34. i: integer;
  35. begin
  36. Result:=0; s:=0;
  37. for i:=1 to length(zlicz) do
  38. begin
  39. if zlicz[i]=' i ' then s:=s+1;
  40. if zlicz[i]=' lub ' then s:=s+1;
  41. if zlicz[i]=' albo ' then s:=s+1;
  42. if zlicz[i]=' lecz ' then s:=s+1;
  43. if zlicz[i]=' ale ' then s:=s+1;
  44. if zlicz[i]=' na ' then s:=s+1;
  45. if zlicz[i]=' zatem ' then s:=s+1;
  46. if zlicz[i]=' bo ' then s:=s+1;
  47. if zlicz[i]=' dlatego ' then s:=s+1;
  48. if zlicz[i]='oraz' then s:=s+1;
  49. Result:=s;
  50. end;
  51. end;
  52.  
  53. var f:text;
  54. licz:string;
  55. begin
  56. assignfile(f, 'tekst.txt');
  57. reset(f);
  58. while not eof(f) do
  59. begin readln(f, licz);
  60. writeln('Liczba samoglosek: ', f1(licz));
  61. writeln('Liczba duzych liter: ', f2(licz));
  62. writeln('Liczba zdan zaczynajacych sie od samogloski: ', f3(licz));
  63. writeln('Liczba cyfr: ', f4(licz));
  64. writeln('Liczba spojnikow: ', f5(licz));
  65. writeln('Suma: ', f1(licz)+f2(licz)+f3(licz)+f4(licz)+f5(licz));
  66. readln;
  67. end;
  68. end.
  69.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Free Pascal Compiler version 2.6.4+dfsg-6 [2015/05/31] for i386
Copyright (c) 1993-2014 by Florian Klaempfl and others
Target OS: Linux for i386
Compiling prog.pas
prog.pas(60,38) Error: Identifier not found "f1"
prog.pas(61,40) Error: Identifier not found "f2"
prog.pas(63,32) Error: Identifier not found "f4"
prog.pas(65,25) Error: Identifier not found "f1"
prog.pas(65,34) Error: Identifier not found "f2"
prog.pas(65,52) Error: Identifier not found "f4"
prog.pas(69) Fatal: There were 6 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