Pagini recente » Cod sursa (job #440367) | Cod sursa (job #1756616) | Cod sursa (job #562739) | Cod sursa (job #960107) | Cod sursa (job #2288255)
program Text;
var
NumarLitere, NumarCuvinte: integer;
c, lastchar: char;
fin, fout: file of char;
begin
assign(fin, 'text.in');
reset(fin);
while not eof(fin) do
begin
read(fin, c);
if (c >= 65 and c <= 90) or (c >= 97 and c <= 122) then
NumarLitere := NumarLitere + 1;
if (not((c >= 65 and c <= 90) or (c >= 97 and c <= 122)) and ((lastchar >= 65 and lastchar <= 90) or (lastchar >= 97 and lastchar <= 122)))
NumarCuvinte := NumarCuvinte + 1;
lastchar := c;
end;
if (lastchar >= 65 and lastchar <= 90) or (lastchar >= 97 and lastchar <= 122))
NumarCuvinte := NumarCuvinte + 1;
close(fin);
assign(fout, 'text.out');
rewrite(fout);
write(fout, NumarLitere div NumarCuvinte);
close(fout);
end.