输出数字循环的方法 请高手给看看 感谢
asp吧
全部回复
仅看楼主
level 3
夜雨0315 楼主
输出数据数字
1(红色)2(黑色)3(蓝色)
4(红色)5(黑色)6(蓝色)
7(红色)8(黑色)9(蓝色)。。。。。。。。。。。不断循环下去
这种如何写呢 用mod 2=0 只能判断奇数 偶数 达不到这个效果
请高手帮忙看看
2014年10月22日 10点10分 1
level 3
夜雨0315 楼主
没人会吗?[狂汗]
2014年10月22日 12点10分 2
mod 3
2014年10月22日 12点10分
mod 3 只能输出123 456 789 可是每个数字的颜色 弄不出来[乖]
2014年10月22日 13点10分
level 3
夜雨0315 楼主
已经有答案了
ii=1
for i=1 to 9
if ii=1 then
elseif ii=2 then
else
end if
rs.movenext
ii=ii+1
next
这个思路解决的,mod那个思路是错的。
2014年10月22日 13点10分 3
level 11
function ds(n)
j=0
for i=1 to n
if i mod 3=1 then
response.Write i&"(红色)"
elseif i mod 3=2 then
response.Write i&"(黑色)"
else
response.Write i&"(蓝色)"
end if
j=j+1
if j mod 3=0 then
response.Write "<br>"
end if
next
end function
call ds(9)
拿去玩吧~~~
2014年10月23日 02点10分 4
好强[大拇指]
2014年10月23日 08点10分
1