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