monsabre1
2015-05-13 00:09:02 +08:00
```python
import datetime
def add(x): return x*100 + 1
def count(x): return x + 1
def f1(a,b):
if b==99:
return a
else:
return f1(add(a),count(b))
def f2():
a=0
for x in xrange(1,100):
a=a*100+1
return a
def main():
starttime = datetime.datetime.now()
print f1(1,1) #fp
endtime = datetime.datetime.now()
print (endtime - starttime).microseconds
starttime = datetime.datetime.now()
print f2() #oo
endtime = datetime.datetime.now()
print (endtime - starttime).microseconds
if __name__=='__main__':
main()
```
输出
```
10101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101
1485
10101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101
116
```