Skip to content

Commit

Permalink
Update ch03-00-declaration.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Euler-37 authored Mar 25, 2024
1 parent 6478bd6 commit 5c92d1c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/ch03-00-declaration.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,17 @@ end program main
```
常量是不可修改的。

同时,我们也可以使用常量来为字面量设置精度
``` fortran
program main
implicit none
integer,parameter::sp=4
real(sp)::a
a=1.234_sp
write(*,*)a
end program main
```

## 注意事项

- Fortran中的变量只能在程序块的开头定义,执行语句(比如赋值语句)不能出现在变量定义的部分。
Expand Down

0 comments on commit 5c92d1c

Please sign in to comment.