Add comments

Added comments to the C code for all the problems solved so far.
This commit is contained in:
2019-09-26 11:38:04 +02:00
parent 9df4d3fe97
commit ecdbadba7e
10 changed files with 153 additions and 65 deletions

View File

@ -15,14 +15,18 @@ def count_digits(n):
def main():
start = default_timer()
for i in range(7654321, 0, -2):
if is_pandigital(i, count_digits(i)) and is_prime(i):
print('Project Euler, Problem 41')
print('Answer: {}'.format(i))
break
i = 7654321
while(i > 0):
if is_pandigital(i, count_digits(i)) and is_prime(i):
break
i = i - 2
end = default_timer()
print('Project Euler, Problem 41')
print('Answer: {}'.format(i))
print('Elapsed time: {:.9f} seconds'.format(end - start))
if __name__ == '__main__':