Pagini recente » Cod sursa (job #1037838) | Cod sursa (job #1883641) | Cod sursa (job #1751175) | Cod sursa (job #1411413) | Cod sursa (job #179355)
Cod sursa(job #179355)
const m:set of char=['a'..'z'];
n:set of char=['A'..'Z'];
var litere,cuvinte:longint;
c:char;
f,g:text;
begin
assign(f,'text.in');reset(f);
assign(g,'text.out');rewrite(g);
cuvinte:=0;
litere:=0;
while not eof(f) do begin
while not eoln(f) do begin
read(f,c);
if c='.' then inc(cuvinte);
if c='!' then inc(cuvinte);
if c='?' then inc(cuvinte);
if c='-' then inc(cuvinte);
if c in m then inc(litere);
if c in n then inc(litere);
end;
end;
write(g,litere div cuvinte);
close(f);
close(g);
end.