请VB高手抽出时间给我答三题,我在线等!!高分

[复制链接]
查看11 | 回复4 | 2008-5-14 09:00:02 | 显示全部楼层 |阅读模式
1.k=1For j=1 to 8k=k*jNext jPrint k 2.dim n as integerdim sum as integern=0sum=0Do while n<=50Sum=sum+nN=n+1Loop 3.dim i as integerfor i=1 to 1000if i mod 13=0 thenprint iend ifnext i
回复

使用道具 举报

千问 | 2008-5-14 09:00:02 | 显示全部楼层
1.k=1 //注意初始化问题,下面也有几处需要如此初始化For j=1 to 8 k=k*j Next j Print k 2.dim n as integer dim sum as integer n=0 sum=0 Do while n<=50 Sum=sum+n N=n+1 Loop 3.dim i as integer for i=1 to 1000 if i mod 13=0 then print i end if next i
回复

使用道具 举报

千问 | 2008-5-14 09:00:02 | 显示全部楼层
有啥用
回复

使用道具 举报

千问 | 2008-5-14 09:00:02 | 显示全部楼层
1.For next语句 dim k as integerdim j as integerk=1 For j=1 to 8 k=k*j Print k & vbcrlfNext j 2.do loop语句 dim sum,nn=0sum=0Do while n<=50 Sum=sum+n N=n+1 Loop print sum3.打印出1000以内能被13整除的整数 dim i as integer for i=1 to 1000 if i mod 13=0 then print i & vbcrlfend if next i
回复

使用道具 举报

千问 | 2008-5-14 09:00:02 | 显示全部楼层
所以说学程序要先学数学,而不是美术- -!1.最后多了个end,并且开始必须把j和k都定义成Long,其他单看代码没问题。2.除了开始要把Sum=0加上外,别的没问题。3.dim i as integerfor i=1 to 1000if i mod 13=0 then print i;next i
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行