Daniele Fucini f8cce530b5
Add more solutions
Added solutions for problems from 41 to 5, both in C and python
2019-09-22 17:47:09 +02:00

23 lines
406 B
Python

#!/usr/bin/python3
from timeit import default_timer
def main():
start = default_timer()
sum_ = 0
for i in range(1, 1001):
power = i ** i
sum_ = sum_ + power
end = default_timer()
print('Project Euler, Problem 48')
print('Answer: {}'.format(str(sum_)[-10:]))
print('Elapsed time: {:.9f} seconds'.format(end - start))
if __name__ == '__main__':
main()