编程 1000内能被3和7整除的数之和 不知道什么语言详情有
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/14 06:25:16
编程 1000内能被3和7整除的数之和 不知道什么语言详情有
开头已经写好了
是public sub program1()
开头已经写好了
是public sub program1()
能被3或者7整除
public sub program1()
dim i as integer,counts as long
for i=1 to 1000
if i mod 3 =0 or i mod 7=0 then
counts=counts+i
end if
next
debug.print counts
end sub
能被3和7同时整除
public sub program1()
dim i as integer,counts as long
for i=1 to 1000
if i mod 3 =0 and i mod 7=0 then
counts=counts+i
end if
next
debug.print counts
end sub
或者因为3,7都是素数(质数),所以能同时给他们整除的数是21的倍数
public sub program1()
dim i as integer,counts as long
for i=1 to 1000
if i mod 21 =0 then
counts=counts+i
end if
next
debug.print counts
end su
public sub program1()
dim i as integer,counts as long
for i=1 to 1000
if i mod 3 =0 or i mod 7=0 then
counts=counts+i
end if
next
debug.print counts
end sub
能被3和7同时整除
public sub program1()
dim i as integer,counts as long
for i=1 to 1000
if i mod 3 =0 and i mod 7=0 then
counts=counts+i
end if
next
debug.print counts
end sub
或者因为3,7都是素数(质数),所以能同时给他们整除的数是21的倍数
public sub program1()
dim i as integer,counts as long
for i=1 to 1000
if i mod 21 =0 then
counts=counts+i
end if
next
debug.print counts
end su
编程 1000内能被3和7整除的数之和 不知道什么语言详情有
求一个c语言编程,分别求出1~1000内能被3,5,7整除的数的和
我想知道c#编程求0~100内能同时被6和9整除的数
C语言编程:求1到100中能被3或7整除的数之和.
C语言编程:从键盘中输入100个数存于数组,计算其100内能被5,7整除的数的和
求c#编程0~100内能同时被6和9整除的数,知道的请回答,
国二C语言编程题:求1-1000之间所有能被7整除或者能被11整除的数之和.
求出数列1、2、3、...、299、300 中所有数之和同时被3和4 整除的数的个数 要求用v b 语言编程
用VF编程求出【1,100】的区间内能被3整除奇数之和
C语言编程 判断一个三位数各位数之和能否被7整除,可以整除的输出否则显示不能被7整除.
c语言编程求1到n中能被3或7整除的数之和.分别用for循环语句和while循环语句完成本题.
用C语言 编程 计算800到2010之间满足被7整除,减一后被3整除的所有自然数之和