Pagini recente » Cod sursa (job #3246558) | Cod sursa (job #2220034) | Cod sursa (job #3036468) | Cod sursa (job #1656025) | Cod sursa (job #331474)
Cod sursa(job #331474)
type fraza=array[1..100000] of char;
var a:fraza;
ok,ok2:boolean;
f,g:text;
i,c,c2:integer;
procedure elitera(i:integer; a:fraza; var ok:boolean);
begin
if ((ord(a[i])>=97)and(ord(a[i])<=122))or((ord(a[i])>=65)and(ord(a[i])<=90)) then ok:=true
else ok:=false;
end;
begin
assign(f,'text.in');
reset(f);
assign(g,'text.out');
rewrite(g);
i:=0;
ok:=false;
ok2:=ok;
c:=0;
c2:=0;
while (a[i]<>#26)or(a[i-1]<>#26)or(a[i-1]<>#26) do
begin
ok2:=ok;
inc(i);
read(f,a[i]);
elitera(i,a,ok);
if ok then inc(c);
if (ok=true) and (ok2=false) then inc(c2);
end;
write(g,c div c2);
close(f);
close(g);
end.