Pagini recente » Cod sursa (job #1910870) | Cod sursa (job #401839) | Cod sursa (job #1855951) | Cod sursa (job #250912) | Cod sursa (job #425936)
Cod sursa(job #425936)
program text1;
var f:text;
nl,nc,c,i:word;
a:array[1..1000000] of char;
function eLitera(x:char):boolean;
begin
if (upcase(x)>='A') and (upcase(x)<='Z') then
eLitera:=true
else
eLitera:=false;
end;
begin
assign(f,'text.in');
reset(f);
nc:=0;
nl:=0;
c:=0;
while not eof(f) do
begin
while not eoln(f) do
begin
c:=c+1;
read(f,a[c]);
end;
readln(f);
end;
for i:=1 to c do
if eLitera(a[i]) then
nl:=nl+1
else
if (i>1) and (eLitera(a[i-1])) then
nc:=nc+1;
close(f);
assign(f,'text.out');
rewrite(f);
writeln(f,nl,' ',nc);
writeln(f,nl div nc);
close(f);
end.