Add comments
Added comments to the C code for all the problems solved so far.
This commit is contained in:
@ -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__':
|
||||
|
Reference in New Issue
Block a user