program Project1;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Classes
{ you can add units after this };
Function f3(zlicz:string):integer;
var s:integer;
i: integer;
n: char;
k: char;
v: char;
begin
Result:=0; s:=0;
for i:=1 to length(zlicz) do
begin
n:=(zlicz[i]);
k:=(zlicz[i-1]);
v:=(zlicz[i+1]);
if (((n=chr(63)) or (k=chr(33)) or (k=chr(46))) and (k=chr(32)) and
((v=chr(65)) or (v=chr(69)) or (v=chr(73)) or (v=chr(79)) or
(v=chr(85)) or (v=chr(89)))) then s:=s+1;
Result:=s;
end;
end;
Function f5(zlicz:string):integer;
var s:integer;
i: integer;
begin
Result:=0; s:=0;
for i:=1 to length(zlicz) do
begin
if zlicz[i]=' i ' then s:=s+1;
if zlicz[i]=' lub ' then s:=s+1;
if zlicz[i]=' albo ' then s:=s+1;
if zlicz[i]=' lecz ' then s:=s+1;
if zlicz[i]=' ale ' then s:=s+1;
if zlicz[i]=' na ' then s:=s+1;
if zlicz[i]=' zatem ' then s:=s+1;
if zlicz[i]=' bo ' then s:=s+1;
if zlicz[i]=' dlatego ' then s:=s+1;
if zlicz[i]='oraz' then s:=s+1;
Result:=s;
end;
end;
var f:text;
licz:string;
begin
assignfile(f, 'tekst.txt');
reset(f);
while not eof(f) do
begin readln(f, licz);
writeln('Liczba samoglosek: ', f1(licz));
writeln('Liczba duzych liter: ', f2(licz));
writeln('Liczba zdan zaczynajacych sie od samogloski: ', f3(licz));
writeln('Liczba cyfr: ', f4(licz));
writeln('Liczba spojnikow: ', f5(licz));
writeln('Suma: ', f1(licz)+f2(licz)+f3(licz)+f4(licz)+f5(licz));
readln;
end;
end.