编写一个程序,输出1到50中间所有能被3整除的正整数.(用while语句实现)

2024-11-17 16:25:02
推荐回答(2个)
回答1:

c语言
main()
{
int i=1;
while(i<=50)
{
if(i%3==0) printf("%d\n",i);
i++;
}
}

回答2:

vbscript:
dim i
i = 1
while i < 51
if i mod 3 = 0 then response.write i
i = i +1
weed