Fortran程序纠错,求助

问题描述

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

Fortran程序纠错,求助的相关文章

c语言-简单的C程序纠错求指导

问题描述 简单的C程序纠错求指导 #include main() { double a,b,c,s; double sabc(double,double,double); printf("请输入三角形三边长:"); scanf("%f%f%f",&a,&b,&c); s=sabc(a,b,c); printf("s=%f",s); } #include double sabc(double a,double b,doubl

急急急解决掉割了-linux下fortran程序调试

问题描述 linux下fortran程序调试 如何在linux下进行fortran程序的调试?如何设置短点?如何读取参数? 解决方案 http://emuch.net/html/201111/3842995.html 解决方案二: linux程序调试Linux程序调试Linux程序调试

c语言-简单的C语言程序--小白求助

问题描述 简单的C语言程序--小白求助 #include<stdio.h> #include<math.h> #include<stdlib.h> #include<string.h> int main() { int N,n,i; char t[1000],s[1000]; scanf("%d",&N); while(N--) { gets(t); scanf("%d",&n); for(i=0;i&

大家谁有Fortran程序和其他程序语言socket通信,实现数据交换的例子?

问题描述 大家谁有Fortran程序和其他程序语言socket通信,实现数据交换的例子? 大家谁有Fortran程序和其他程序语言socket通信,实现数据交换的例子? 解决方案 用c去实现网络通讯,fortran去调用 http://blog.chinaunix.net/uid-21498513-id-143992.html 解决方案二: http://blog.chinaunix.net/uid-21498513-id-143992.html

fortran-ShellExecute调用Fortran程序

问题描述 ShellExecute调用Fortran程序 MFC中使用ShellExecute调用Fortran程序,调用后,Fortran程序中输入计算文件编号,但是没有进行计算(Fortran程序默认搜索所在文档,文档内存在计算文件,直接运行Fortran程序可进行计算).是不是要把Fortran程序的计算文件放在MFC文件夹内才行,请教各位大侠,谢谢各位! 解决方案 先用命令行执行,看能不能执行,看上去可能你的命令行参数等有问题 解决方案二: c++调用fortran程序的方法C++调用F

c++程序用途求助.....

问题描述 c++程序用途求助..... #include#includeusing namespace std;double Pn(int,double); //声明函数int main(){ int n; char i; double x; while(1) { cout << "Please enter an int number:"; while(!(cin >> n)) //键入n的值 { cout << "err!!!n"

c-一个简单的C++程序,求助。

问题描述 一个简单的C++程序,求助. bool func(const string &); int main(void) { vector vec{ "strings", "helloworld", "zay", "uah", "kakaka" }; auto it = partition(vec.cbegin(), vec.cend(), func); auto begin = vec.begi

程序代码-求助! 刚开始学C++,勉强写了这个程序,希望有大神帮忙改一下下~~

问题描述 求助! 刚开始学C++,勉强写了这个程序,希望有大神帮忙改一下下~~ #include "stdafx.h" #include "cstring" #include "cstdio" #include "iostream" using namespace std; class Vect{ private: int *comp;//用于储存向量中的各个分量: size_t len;//向量长度: static int

程序代码-(求助)openssl中的des调用

问题描述 (求助)openssl中的des调用 des加密中的ks为128字节,但实际上8字节不就可以了吗?形参和实参不会结合,求帮助 解决方案 OpenSSL - DESopenssl des 加密解密openssl 调用实例 解决方案二: 1.8字节是des算法的原始秘钥,128字节是原始秘钥处理过的秘钥: 2.主要是为了提升des的性能.