Skip to content

Commit

Permalink
Update 01.Data-Structures-Algorithms.md
Browse files Browse the repository at this point in the history
  • Loading branch information
itcharge committed Nov 14, 2021
1 parent 4fdf294 commit 69e63a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Contents/00.Introduction/01.Data-Structures-Algorithms.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@

> 问题:如何计算 1 + 2 + 3 + ... + 100 的值?
>
> 解决方法:我们可以选择用计算器从 1 开始,不断向右依次加上 2,再加上 3,再加上 ... 直到加到 100,得出结果为 5050。也可以选择直接根据高斯求和公式 `和 = (首项 + 末项) * 项数`,直接算出结果为 $ \frac{(1+100) * 100}{2} = 5050$。
> 解决方法:我们可以选择用计算器从 1 开始,不断向右依次加上 2,再加上 3,再加上 ... 直到加到 100,得出结果为 5050。也可以选择直接根据高斯求和公式 `和 = (首项 + 末项) * 项数 / 2`,直接算出结果为 $ \frac{(1+100) * 100}{2} = 5050$。
- 例三:

Expand Down

0 comments on commit 69e63a6

Please sign in to comment.