day02/

directory
v0.0.0-...-19a3f40 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2024 License: MIT

README

作业

  1. 请将这段二进制翻译成中文(unicode编码), b并打印出翻译过程(比如 二进制: 1000 1000 0110 0011, unicode: U+8863, 字符: 衣)
// 1000 1000 0110 0011
// 0110 0111 0000 1101
// 0101 0101 1001 1100
// 0110 1011 0010 0010
// 0111 1010 0111 1111
// 0100 1110 0010 1101
// 0101 0110 1111 1101
// 0111 1110 1010 0010
  1. 写一个单位转换的函数, 同学只需要把函数逻辑部分编写完成,

测试方法: main 函数内部 通过HumanBytesLoaded(1024)调用

// HumanBytesLoaded 单位转换(B KB MB GB TB EB)
func HumanBytesLoaded(bytesLength int64) string {
    var resp string

    // bytesLength
    fmt.Printf("需要转换的值: %dB", bytesLength)

    // 单位转换的逻辑 将 bytesLength ==> resp, 比如 1024 ==> 1KB

    // 返回转换的结果
    return resp
}
  1. 做一个抽卡程序, 中奖率万分之一, 看看你多少个10连能中奖
请回答如下问题, 比如: a + b =:  m
恭喜你 回答正确,随机获取n[1~10]的抽奖机会
当前是你第1次抽奖: 抽奖结果 未中奖  
当前是你第2次抽奖. 抽奖结果 未中奖
当前是你第3次抽奖. 抽奖结果 未中奖
...
  1. 抽奖

答案参考

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL