2015-11-27 18:54:43 +01:00
|
|
|
package main
|
|
|
|
|
|
|
|
func fibo(n int ) int {
|
|
|
|
|
|
|
|
result := 0
|
|
|
|
a := 0
|
|
|
|
b := 1
|
|
|
|
i := 1
|
|
|
|
|
|
|
|
for( i < n ) {
|
|
|
|
result = a + b;
|
|
|
|
a = b;
|
|
|
|
b = result;
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
return result
|
|
|
|
}
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
sum := 1
|
2019-07-31 20:18:03 +02:00
|
|
|
res := 0
|
|
|
|
for sum < 50000 {
|
2015-11-27 18:54:43 +01:00
|
|
|
sum += 1
|
2019-07-31 20:18:03 +02:00
|
|
|
res = fibo( 40 )
|
2015-11-27 18:54:43 +01:00
|
|
|
}
|
2019-07-31 20:18:03 +02:00
|
|
|
res += 1
|
2015-11-27 18:54:43 +01:00
|
|
|
}
|