dimension a (3) s=0 for k=1 to 3 a(k)=3-k s=s+k endfor a(1),a(2),a(3),s
问题描述:
dimension a (3) s=0 for k=1 to 3 a(k)=3-k s=s+k endfor a(1),a(2),a(3),s
答
so easy .first ,we move on to k.If k equals 1,then we have a(1)=3-1=2.Thus S=0+k=0+1=1next,again,we continue this process ,which we have a(2)=3-2=1.And S=1+2=3.Finally,if k is 3,we will get a(3)=3-3=0...