Pagini recente » Cod sursa (job #1797092) | Cod sursa (job #1534751) | Cod sursa (job #2481512) | Cod sursa (job #1298351) | Cod sursa (job #405621)
Cod sursa(job #405621)
var i,db,szo:longint;
s:string;
f,g:text;
Begin
assign(f,'text.in'); reset(f);
assign(g,'text.out'); rewrite(g);
readln(f,s);
db:=0; szo:=0;
for i:= 1 to length(s)-1 do
begin
if upcase(s[i]) in ['A'..'Z'] then db:=db+1;
if (upcase(s[i]) in ['A'..'Z']) and
not (upcase(s[i+1]) in ['A'..'Z'])
then szo:=szo+1;
end;
if upcase (s[length(s)]) in ['A'..'Z'] then db:=db+1;
if (upcase (s[length(s)]) in ['A'..'Z'])and
not(upcase(s[length(s)-1]) in ['A'..'Z']) then szo:=szo+1;
writeln(g,db,' ',szo,' ',db div szo);
close(f);
close(g);
End.