Cod sursa(job #328157)

Utilizator vrvp.pasveigang radulescu vlad petru vrvp.pas Data 1 iulie 2009 10:27:15
Problema Text Scor 100
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.78 kb
var nr1,nr2:longint;
f,g:text;
c,t:char;
begin
assign(f,'text.in');reset(f);
assign(g,'text.out');rewrite(g);
while not eof(f) do begin
  read(f,c);
  t:=c;
  while upcase(c) in ['A'..'Z'] do begin
    inc(nr1);
    t:=c;
    read(f,c);
  end;
if (nr1>0) and (not (upcase(c) in ['A'..'Z'])) and (upcase(t) in ['A'..'Z']) then
  inc(nr2);
end;
writeln(g,nr1 div nr2);
close(g);
end.
var nr1,nr2:longint;
f,g:text;
c,t:char;
begin
assign(f,'text.in');reset(f);
assign(g,'text.out');rewrite(g);
while not eof(f) do begin
  read(f,c);
  t:=c;
  while upcase(c) in ['A'..'Z'] do begin
    inc(nr1);
    t:=c;
    read(f,c);
  end;
if (nr1>0) and (not (upcase(c) in ['A'..'Z'])) and (upcase(t) in ['A'..'Z']) then
  inc(nr2);
end;
writeln(g,nr1 div nr2);
close(g);
end.