We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2977ac8 commit 778d5a4Copy full SHA for 778d5a4
src/ch04-00-if.md
@@ -7,11 +7,20 @@ Fortran中使用条件语句`if(<condition>)then`来表示某条语句在满足
7
当`if`结构中的语句**只有一行**时,可是省略`then`和`end if`,写为一行
8
9
``` fortran
10
-if (angle < 90) then
11
- write(*,*)"锐角"
12
-end if
13
-!等价形式
14
-if(angle < 90) write(*,*)"锐角"
+program main
+ implicit none
+ integer::angle=10
+ if (angle < 90) then
+ write(*,*)"锐角"
15
+ end if
16
+ !等价形式
17
+ if(angle < 90) write(*,*)"锐角"
18
+end program main
19
+```
20
+``` sh
21
+$ fpm run
22
+ 锐角
23
24
```
25
- 在 if 结构中缩进代码是一种很好的做法,以使代码更具可读性。
26
0 commit comments