| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

PE008

Page history last edited by Kenneth Finnegan 15 years, 10 months ago

Project Euler Problem #8

 

Nothing too clever about this solution, just brute forced it.  The most interesting part about my solution was how I quickly changed the 20 lines of numbers into one string in vim:

19J     J concatenates the next line onto the current.  19 does it 19 times.

:s/ //g     This is the typical search and substitute function, replacing all the spaces with nothing.  Had to readd spaces for the char input[] = "... part, but thats easier than deleting 19 spaces in the number.

 

 008.c

 


Return to list of solutions

Comments (0)

You don't have permission to comment on this page.