整数 溢出
作者:互联网
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
标签:lie,return,int,lcof,整数,int64,var,溢出 来源: https://www.cnblogs.com/rsapaper/p/16153946.html