1 fortran
我是编程的新手。我开始用 Fortran 编写我的 Hello world,但启动画面非常快。为什么我什么都看不到?为什么黑屏不显示:“hello world”?
我看到启动画面,但它以光速消失了......
program HelloWorld
write (*,*) 'Hello, world!' ! This is an inline comment
end program HelloWorld
Run Code Online (Sandbox Code Playgroud)
you can try pause at the point you want to stop the program for example
program HelloWorld
write (*,*) 'Hello, world!' ! This is an inline comment
pause
end program HelloWorld
Run Code Online (Sandbox Code Playgroud)
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