Cod sursa(job #969833)
| Utilizator | Data | 5 iulie 2013 14:38:24 | |
|---|---|---|---|
| Problema | Text | Scor | 0 |
| Compilator | fpc | Status | done |
| Runda | Arhiva de probleme | Marime | 0.57 kb |
program a1;
var s:string;
litere,cuv,i:integer;
a,b:text;
begin
assign(a,'texr.in');
assign(b,'text.out');
reset(a);
rewrite(b);
readln(a,s);
litere:=0;
cuv:=0;
for i:=1 to length(s) do
begin
if (s[i] in ['a'..'z']) or (s[i] in ['A'..'Z'] then inc(litere);
if i = 1 then
begin
if (s[i] in ['a'..'z']) or (s[i] in ['A'..'Z']) then
begin
inc(cuv);
end
else
begin
if ((s[i] in ['a'..'z']) or (s[i] in ['A'..'Z'])) and (not (s[i-1] in ['a'..'z'])) and (not
(s[i-1] in ['A'..'Z']))
then inc(cuv);
end;
end;
end;
write(b,litere div cuv);
close(a);
close(b);
end.
