Cod sursa(job #130814)
| Utilizator | Data | 1 februarie 2008 23:15:36 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | fpc | Status | done |
| Runda | Arhiva de probleme | Marime | 0.74 kb |
var k,c:longint;
m:set of char;
f,g:text;
p:boolean;
uc,ch:char;
begin
assign(f,'text.in');
reset(f);
assign(g,'text.out');
rewrite(g);
c:=0;
k:=0;
m:=['A'..'Z']+['a'..'z'];
uc:=#0;
ch:=#0;
while not eof(f) do
begin
uc:=ch;
read(f,ch);
if (ch in m) then inc(k)
else begin
if (uc in m) and Not(ch in m) then
inc(c);
end;
end;
if ch in m then inc(c);
if (k=0) Or (c=0) then write(g,0)
else write(g,k div c);
close(f);
close(g);
end.