Cod sursa(job #1484718)

Utilizator cyber_ghSoltan Gheorghe cyber_gh Data 11 septembrie 2015 18:34:27
Problema Text Scor 50
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.6 kb
program text;
var f1 : textfile;
f2 : textfile;
c:array[1..10000] of char;
i,k,j,n,x,y : integer;
begin
i:=1;
assign(f1,'text.in');
reset(f1);
while not eof(f1) do begin
read(f1,c[i]);

if ((c[i] >='A')and( c[i]<='Z')) or ((c[i] >='a')and (c[i]<='z')) then
inc(k);
inc(i);
end;
close(f1);
for j:=1 to i do begin

if (((c[j] >='A')and( c[j]<='Z')) or ((c[j+1] >='a')and (c[j+1]<='z'))) and (not(((c[j+1] >='A')and( c[j+1]<='Z')) or ((c[j] >='a')and (c[j]<='z')))) then
x:=x+1;

end;
y:=trunc(k/x);
  assign(f2,'text.out');
  rewrite(f2);
  write(f2,y);
  close(f2);




end.