Cod sursa(job #1538816)

Utilizator Vlad_CernoutanVlad Cernoutan Vlad_Cernoutan Data 29 noiembrie 2015 20:20:50
Problema Text Scor 40
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.44 kb
Program text1;
 var a : string;
     fi, fo : text;
     i, k1, k2 : integer;

begin
 assign(fi, 'text.in');
 assign(fo, 'text.out');
 reset(fi);
 rewrite(fo);
 readln(fi, a);
 for i:=1 to length(a) do begin
                           if a[i] in ['a'..'z', 'A'..'Z'] then inc(k1);
                           if a[i] in [' '] then inc(k2);
                          end;

 writeln(fo, k1 div (k2+1) );
 writeln(fo);
 close(fo);
end.