问题描述
- Fortran程序纠错,求助
-
菜鸟一个,求各位大神指教哪里有错误,断点调试J值跳动
求3-200的素数输出,万分感谢呀。
program main
integer i,j
print*,'2-200之间素数有:'
do i=3,200
do j=2,i-1
if(mod(i,j)/=0) then
print*,i
else
endif
enddo
enddo
end
解决方案
代码根本就不对,哪里能一判断不能整除就输出呢?素数是全部不能整除才是。
解决方案二:
对噢 好像被戳中了 谢谢苏小喵
时间: 2024-09-15 07:19:31