gpt4 book ai didi

c++ - 使用寓言从Fortran 77转换为C++

转载 作者:行者123 更新时间:2023-12-02 10:25:49 25 4
gpt4 key购买 nike

我只是想使用寓言将基本的helloworld.f程序转换为C++(以备以后使用更大的程序)。我收到一个错误,虽然说:

fable.read.Error: Missing END for PROGRAM:
at hello.f(1):
| program HelloWorld|

我不了解,因为它可以编译并正常运行。该程序只是:
  program HelloWorld
implicit none
write (*,*) 'Hello, world!' ! This is an inline comment
end program HelloWorld

有人看到寓言找到的问题吗?我以前从未使用过它,所以我只是想看看它是如何工作的。在此先感谢您的帮助!

最佳答案

我认为它不能解析end program HelloWorld。尝试将其更改为end program或仅更改为end
更新:确实,在Fortran 77中,所有内容都必须以with just END结尾:

The END statement indicates the end of the sequence of statements and comment lines of a program unit ( 3.5). If executed in a function or subroutine subprogram, it has the effect of a RETURN statement ( 15.8). If executed in a main program, it terminates the execution of the executable program.

The form of an END statement is:

END

An END statement is written only in columns 7 through 72 of an initial line. An END statement must not be continued. No other statement in a program unit may have an initial line that appears to be an END statement.The last line of every program unit must be an END statement.

关于c++ - 使用寓言从Fortran 77转换为C++,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25786543/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com