> 其他 >
编一程序,判断自然数n是否为素数(素数是只能被1和它本身整除的数) 求答案..急!
人气:287 ℃ 时间:2019-08-16 23:50:45
解答
用vb的:dim i%,n%,pd as booleanpd=truefor i=2 to n-1if(n mod i)=o then pd=falsenextif abc thenprint n & "是素数" elseprint n & "不是素数" end if c语言的:void main(){\x05int i,n;\x05abc:\x05printf("请...
推荐
猜你喜欢
© 2024 79432.Com All Rights Reserved.
电脑版|手机版