Cod sursa(job #152876)

Utilizator DanielGGlodeanu Ioan Daniel DanielG Data 9 martie 2008 21:13:00
Problema Text Scor 50
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.75 kb
type vector=array[1..52] of CHAR;
const v:vector=('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',
'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z');
var c:char;
kk,nr,nrs,nrcuv:longint;
f,g:text;
i:byte;
ok:boolean;
begin
assign(f,'text.in');reset(f);
assign(g,'text.out');rewrite(g);
ok:=false;
kk:=1;
while not eof(f) do
begin
read(f,c);
if ((c=' ') or ((c='-') and ok=true)) then
begin
ok:=true;
if kk=1 then
inc(nrs);
inc(kk);
end
else
begin
for i:=1 to 52 do
if c=v[i] then
begin
inc(nr);
kk:=1;;;
break;
end;
end;
if eoln(f) then readln(f);
end;
nrcuv:=trunc(nr/nrs);
write(g,nrcuv);
close(f);
close(g);
end.