Mai intai trebuie sa te autentifici.
Cod sursa(job #128899)
Utilizator | Data | 28 ianuarie 2008 10:52:29 | |
---|---|---|---|
Problema | Text | Scor | 70 |
Compilator | fpc | Status | done |
Runda | Arhiva de probleme | Marime | 0.8 kb |
var s:string;
i,k,q,c:integer;
m:set of 'a'..'z';
n:set of 'A'..'Z';
f,g:text;
a:array[1..10000] of char;
begin
assign(f,'text.in');
assign(g,'text.out');
reset(f);
rewrite(g);
q:=0;
while not eof(f) do begin
inc(q);
read(f,a[q]);
end;
m:=['a'..'z'];
n:=['A'..'Z'];
i:=1;
while not (a[q] in m+n) do begin
a[q]:='0';
dec(q);
end;
repeat
while not (a[i] in m+n) do begin
a[i]:='0';
inc(i);
end;
while a[i] in m+n do begin
inc(k);
a[i]:='0';
inc(i);
end;
inc(c);
until a[q]='0';
write(g,k div c);
close(f);
close(g);
end.