启动画面太快,我看不到 Fortran 程序的结果
我是编程新手。我开始用 Fortran 语言编写 Hello world,但启动屏幕速度非常快。为什么我看不到任何东西?为什么黑屏不显示我:“hello world”?
我看到闪屏,但它以光速消失了......
program HelloWorld
write (*,*) 'Hello, world!' ! This is an inline comment
end program HelloWorld
I am newbie to programming. I start write my Hello world in Fortran but the splash screen is very fast. Why can't I see anything? Why is the black screen not showing me: "hello world"?
I see splash screen but it vanishes in the speed of light...
program HelloWorld
write (*,*) 'Hello, world!' ! This is an inline comment
end program HelloWorld
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
你可以尝试在你想要停止程序的地方暂停,例如
在显示“hello world”之后,cmd窗口仍然会保持,因为暂停功能,在检查结果后,按回车键。 FORTRAN 将执行下面的代码暂停
我希望这个命中可以帮助你
you can try pause at the point you want to stop the program for example
after the 'hello world' was displayed, the cmd windows will still hold on,because the pause function,after check your result, press Enter. the FORTRAN will do the code below pause
I hope this hit can help you
我猜你的 Fortran 程序正在写入屏幕,然后当程序完成时屏幕就会消失。有点像 Windows 命令窗口。
尝试在写入之后添加从控制台读取的语句。您不关心从控制台读取什么,但在读取等待控制台输入时,您将在窗口中看到写入语句的结果。
I'm guessing that your Fortran program is writing to the screen, then the screen disappears when the program completes. Sort of like a Windows command window.
Try putting a read from console statement after the write. You don't care what you're reading from the console, but you'll see the results of the write statement in the window while the read waits for console input.
我猜你用的是Windows。
如果您的可执行程序位于 c:\foo\a.exe,您可以使用(开始、运行、“cmd”)打开 Windows 控制台,使用“cd”命令移动到 c:\foo 目录,然后键入a.exe 在提示符(或简称“a”)下运行您的程序。输出将出现在 Windows 控制台中。要将输出重定向到文件,您可以键入“a.exe > some_file.txt”。使用 Windows 的初级程序员应该了解一些有关 Windows 命令行的知识,包括基本命令,如“cd”、“dir”和“findstr”。
I will guess you are using Windows.
If your executable program is at c:\foo\a.exe, you can open a Windows console with (Start, Run, "cmd"), move to the c:\foo directory using the "cd" command, and then type a.exe at the prompt (or simply "a") to run your program. The output will appear in the Windows console. To redirect the output to a file, you can type "a.exe > some_file.txt". Beginning programmers using Windows should learn a little about the Windows command line, including basic commands such as "cd", "dir", and "findstr".
我也面临着同样的问题..但后来我在我的win32位中启用了win16位..这解决了问题
I was also facing the same problem.. but then i enabled win16- bit in my win32bit.. which solved the problem