整数 溢出
https://leetcode-cn.com/problems/fei-bo-na-qi-shu-lie-lcof/
func fib(n int) int {
var m int64 = 1000000007
if n == 0 {
return 0
}
if n == 1 {
return 1
}
if n ==2 {
return 1
}
var r, a, b int64
a = 1
b = 1
for i := 2; i < n; i++ {
r = a + b
a = b
b = r
}
return int(r % m)
}
0 <= n <= 100