Pagini recente » Cod sursa (job #2726023) | Cod sursa (job #442622) | Cod sursa (job #1386023) | Cod sursa (job #2377426) | Cod sursa (job #38458)
Cod sursa(job #38458)
Program textul;
Var alfabet:set of char;
f:text;
c,nc:longint;
s,ss:char;
Begin
alfabet:=['a'..'z','A'..'Z'];
assign(f,'text.in');
reset(f);
c:=0;
nc:=0;
s:='=';
repeat
ss:=s;
read(f,s);
if s in alfabet then c:=c+1;
if ss<>'=' then if (not(s in alfabet)) and (ss in alfabet) then nc:=nc+1;
until(eoln(f));
close(f);
if s in alfabet then nc:=nc+1;
assign(f,'text.out');
rewrite(f);
if nc=0 then Writeln(f,'0')
else Writeln(f,c div nc);
close(f);
Writeln;
End.