Cod sursa(job #291763)
| Utilizator | Data | 30 martie 2009 13:00:12 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| Compilator | fpc | Status | done |
| Runda | Arhiva de probleme | Marime | 0.56 kb |
program test;
var be,ki:text;
nrcuvinte,lungcuvinte:longint;
c:char;
H:set of char;
begin
h:=['A'..'Z','a'..'z'];
assign(be,'text.in');
assign(ki,'text.out');
reset(be);
rewrite(ki);
nrcuvinte:=1;
read(be,c);
repeat
if c=' ' then inc(nrcuvinte);
while c=' ' do
begin
read(be,c);
if eoln(be) then break;
end;
while c<>' ' do
begin
if c in h then inc(lungcuvinte);
read(be,c);
if eoln(be) then break;
end
until eoln(be);
writeln(ki,lungcuvinte div nrcuvinte);
close(ki);
end.