# 第五章课后习题答案

1、For i:=’z’ downto ‘a’ do write(i); 2、For i:=1 to 50 do Begin Read(a); If a>85 then yx:=yx+1; If (a>60) and (a<85) then yb:=yb+1; ……. End; Write(yx,….); 3、read(n); for i:=1 to n do

if odd(i) then begin s:=s+I; write(i); end; write(s); 4、read(n); for i:=1 to n do if n mod I =0 then s:=s+1; write(s); 5、read(n); for i:=1 to n do s:=s+1/(I*I); pai:=sqrt(6*s); 6、 x:=1 For I:=9 downto 1 do X:=2*(x+1); Write(x); 7、 repeat n:=n+1; s:=s+1/(n*n); until 1/(n*N)<1e-6 pai:=sqrt(6*s); 8、read(ch); while ch<>’?’ do begin if (ch>=’a’)and(ch<=’z’) or (ch>=’A’)and(ch<=’Z’) then zm:=zm+1 else if (ch>=’0’) and (ch<=’9’) then sz:=sz+1

else qt:=qt+1; read(ch); end; 9、s:=14; repeat n:=n+1; s:=s*(1+0.015); until s>28 10、 read(n); bj:=trunc(sqrt(n)); while (k<bj) or (biaoji=0) do begin k:=K+1; if n mod k=0 then biaoji:=1; end; if biaoji=0 then write(n); 11、 read(x); while x<>0 do begin if x=101 then s:=s+10.5; if ……… read(x); end; write(s); 12、 for i:=1 to 26 do begin for m:=27 downto i do write(' '); for j:=1 to i do write(chr(j+64)); for k:=i-1 downto 1 do write(chr(k+64)); writeln; end; 1 、 s:=1; for i:=1 to 10 do s:=s*3; write(s); 2 、

h:=80; s:=80; for i:=1 to 7 do begin h:=h/2; s:=s+2*h; end; 3、 for i:=2 to 1000 do begin for j:=1 to i-1 do if I mod j = 0 then s:=s+j; if i=s then write(i); end; 4、 while bj<>1 do begin m:=0; m:=m+1; for n:=1 to m-1 do beign x:=1; y:=1; for i:=1 to m do begin //x:=x mod 10000 x:=x*1989; a:=x mod 1000 end; for j:=1 to n do begin //y:=y mod 10000 y:=y*1989; b:=y mod 1000 end; if a=b then begin write(m,n); bj:=1；end; end;

### Java课后习题答案第五章

java经典课后习题答案 3页 1财富值如要投诉违规内容,请到百度文库投诉中心;如要提出功能问题或意见建议,请点击此处进行反馈。 Java课后习题答案第五章 java课后习题...