Cod sursa(job #1538840)

Utilizator Vlad_CernoutanVlad Cernoutan Vlad_Cernoutan Data 29 noiembrie 2015 21:04:18
Problema Text Scor 100
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.69 kb
Program text1;
 var fi, fo : text;
    x,y : char;
    k1,K2 : longint;
begin
 assign(fi,'text.in'); reset(fi);
 assign(fo,'text.out'); rewrite(fo);
 k1:=0;
 k2:=0;
 read(fi,x);
 y:=x;
 if (x in ['a'..'z']) or (x in ['A'..'Z']) then inc(k1);
 while not eof(fi) do begin
                       read(fi, x);
                       if (x in ['a'..'z']) or (x in ['A'..'Z']) then inc(k1);
                       if ((y in ['a'..'z']) or (y in ['A'..'Z'])) and (not(x in ['A'..'Z'])) and (not(x in ['a'..'z'])) then inc(k2);
                       y:=x;
                      end;
 if (x in ['a'..'z']) or (x in ['A'..'Z']) then inc(k2);
 writeln(fo, k1 div k2);
 close(fi);
 close(fo);
end.