Skip to content

Commit

Permalink
Update ch03-03-array.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Euler-37 authored Mar 25, 2024
1 parent 85e05c6 commit 4abae95
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ch03-03-array.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ end program arrays

数组的初始化有多种方式。

首先,Fortran支持将数组整体赋值,例如 `a=1`的形式就是将数组a中的元素全部赋值为1
首先,Fortran支持将数组整体赋值例如 `a=1`的形式就是将数组a中的元素全部赋值为1

其次就是数组构造器,语法是`[]`
其次就是数组构造器语法是`[]`

同时数组还支持整体操作,包括运算符`+-*/`以及`**`,还有所有的逻辑运算符,对应的操作就是数组的对应位置做相应的算数操作,因此**数组整体操作的时候数组大小和维度必须相同,或者为标量**
同时数组还支持整体操作包括运算符`+-*/`以及`**`,还有所有的逻辑运算符对应的操作就是数组的对应位置做相应的算数操作因此**数组整体操作的时候数组大小和维度必须相同,或者为标量**
``` fortran
program arrays
implicit none
Expand All @@ -59,7 +59,7 @@ end program arrays

## 数组的切片

数组的切片使用的语法是`(start:end[:step])`,其中step可以是任意的整数,包括负数。
数组的切片使用的语法是`(start:end[:step])`其中step可以是任意的整数,包括负数。

-`step=1`时,可以省略
-`end`表示的是数组末尾的时候,可以省略
Expand Down

0 comments on commit 4abae95

Please sign in to comment.