Cod sursa(job #545606)

Utilizator palatyimAtyim Paul palatyim Data 3 martie 2011 18:03:08
Problema Text Scor 100
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.6 kb
program textinfo;
var t : array[1..1000000] of char;
var b :char;
var s1,s2,i,c :longint;
var f,ff :text;
begin
assign(f,'text.in');
reset(f);
while not eof(f) do
begin
read(f,b);
i:=i+1;
t[i]:=b;
end;
close(f);
for c:=1 to i do
begin
if (t[c] in ['a'..'z']) or (t[c] in ['A'..'Z']) then
s1:=s1+1;
if  ((t[c] in ['a'..'z'])) and ((t[c+1] in ['a'..'z'])=false) and ((t[c+1] in ['A'..'Z'])=false) or ((t[c] in ['A'..'Z'])) and ((t[c+1] in ['A'..'Z'])=false) and ((t[c+1] in ['a'..'z'])=false) then
s2:=s2+1;
end;
assign(ff,'text.out');
rewrite(ff);
write(ff,s1 div s2);
close(ff)
end.