vfp编程题,最后运行结果是111011,为什么我算一直是11011
3个回答
2014-06-19
展开全部
111011没有错。
set talk off
n = 59
as = ''
do while n>0
as = str(mod(n,2),1) + as
n=int(n/2)
?'n=' + str(n) + ' /as = ' + as
enddo
?as
set talk on
return
set talk off
n = 59
as = ''
do while n>0
as = str(mod(n,2),1) + as
n=int(n/2)
?'n=' + str(n) + ' /as = ' + as
enddo
?as
set talk on
return
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
应该是110111 吧
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询