



时间:2015-12-17 关注公众号 来源:网络
【创建fortran工程】
【编写代码】
program main
implicit none
integer::a,i,flag
flag=1
read *,a
do i=2,a-1
if(mod(a,i)==0)then
flag=0
exit
end if
end do
if(flag==1)then
print *,a,"是素数"
else
print *,a,"不是素数"
end if
end
【在codeblocks中编译、链接】
【运行、测试结果】
文章内容来源于网络,不代表本站立场,若侵犯到您的权益,可联系我们删除。(本站为非盈利性质网站)
电话:13918309914
QQ:1967830372
邮箱:rjfawu@163.com