- Same algorithm implementation has different retults in Python and C ?
- def fib(x):
- v = 1
- u = 0
- for x in xrange(1,x+1):
- t = u + v
- u = v
- v = t
- return v
- int fib(int x)
- {
- int v = 1;
- int u = 0;
- int t;
- for (int i = 1; i != x + 1; i++)
- {
- t = u + v;
- u = v;
- v = t;
- }
- return v;
- }