mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-11-13 09:16:10 +08:00
翻译修正 (#584)
* 翻译修正 ISAM -> IsAM Exercise 9.4: The function which does the test is contained in a package even 将测试所用的函数编写在 even 包里。 https://github.com/Unknwon/the-way-to-go_ZH_CN/blob/master/eBook/exercises/chapter_9/even/even.go 在练习源代码里也证实了这一点 * 修正我自己的pr 前文用的判断,后文应该也是判断,我的失误
This commit is contained in:
@@ -149,13 +149,13 @@ b)一个源文件是否能包含多个包?
|
|||||||
|
|
||||||
**练习 9.3**
|
**练习 9.3**
|
||||||
|
|
||||||
创建一个程序 main_greetings.go 能够和用户说 "Good Day" 或者 "Good Night"。不同的问候应该放到 greetings 包中。
|
创建一个程序 main_greetings.go 能够和用户说 "Good Day" 或者 "Good Night"。不同的问候应该放到单独的 greetings 包中。
|
||||||
|
|
||||||
在同一个包中创建一个 ISAM 函数返回一个布尔值用来判断当前时间是 AM 还是 PM,同样创建 `IsAfternoon` 和 `IsEvening` 函数。
|
在同一个包中创建一个 `IsAM` 函数返回一个布尔值用来判断当前时间是 AM 还是 PM,同样创建 `IsAfternoon` 和 `IsEvening` 函数。
|
||||||
|
|
||||||
使用 main_greetings 作出合适的问候(提示:使用 time 包)。
|
使用 main_greetings 作出合适的问候(提示:使用 time 包)。
|
||||||
|
|
||||||
**练习 9.4** 创建一个程序 main_oddven.go 判断前 100 个整数是不是偶数,包内同时包含测试的功能。
|
**练习 9.4** 创建一个程序 main_oddven.go 判断前 100 个整数是不是偶数,将判断所用的函数编写在 even 包里。
|
||||||
|
|
||||||
**练习 9.5** 使用第 6.6 节的斐波那契程序:
|
**练习 9.5** 使用第 6.6 节的斐波那契程序:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user