Fortran の "Hello, world!"

Emacs で以下のファイル(ファイル名は sample00.f90)を編集。
write(*,*), 'Hello, world!'
stop
end
あとは、コマンドラインで
$ gfortran sample00.f90
とし、エラーメッセージが無い事を確認してから、
$ ./a.out
とすれば、"Hello, world!" が表示される。

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.