2022-09-04:以下go语言代码输出什么?A:不能编译;B:45;C:45.2;D:45.0。
package main
import (
"fmt"
)
func main() {
var ans float64 = 15 + 25 + 5.2
fmt.Println(ans)
}
答案选C。这道题有很多人选A。15 + 25 + 5.2在编译期间做处理。
福大大架构师每日一题 博主文章分类:福大大架构师每日一题 ©著作权
2022-09-04:以下go语言代码输出什么?A:不能编译;B:45;C:45.2;D:45.0。
package main
import (
"fmt"
)
func main() {
var ans float64 = 15 + 25 + 5.2
fmt.Println(ans)
}
答案选C。这道题有很多人选A。15 + 25 + 5.2在编译期间做处理。
上一篇:2022-08-28:把字符串 s 看作 “abcdefghijklmnopqrstuvwxyz“ 的无限环绕字符串, 所以 s 看起来是这样的: ...zabcdefghijklmnopqrstuv
下一篇:2022-08-26:用一个大小为 m x n 的二维网格 grid 表示一个箱子 你有 n 颗球。箱子的顶部和底部都是开着的。 箱子中的每个单元格都有一个对角线挡板,跨过单元格的两个角, 可以将球导
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M