All you have to do is read a text file containing 100 pairs of numbers, then multiply the two numbers in each pair together and output them into another file. You have to do this as quickly as possible in C, C++ or C# and time how long it takes to multiply all 100 pairs of numbers.
So what's the catch? Well the numbers are each 100 digits long and you can't use any 3rd party library to do the multiplication. You must code it yourself. The answers should be about 200 digits long.
The numbers file Download Numbers File consists of 200 lines of input numbers, with each line having exactly one 100 digit number. So read them all in and multiply the first two together then the next two and so on.
Output
This should be a text file called answers.txt in the same folder as your executable. It should have 100 lines each with a 200 digit number.Please include the total time it took, including the time to load the numbers data file and output the answers file. This is the code that you can use for timing.
Results
Congratulations to Makis whose multi threading multiply was very fast indeed. The top ten have a link to the download of their source files as submitted. Thank you to everyone who entered.Note: I made a mistake with Stole's timing and left out Dennis Muhlestein's entry completely but both are now fixed.
- Makis Tsintsikloglou (Greece,33) - C# Score = Time(secs) = 0.0021329
- Michael Chock - C++ Score = Time(secs) = 0.00697955
- Vivek Malhotra - C++ Score = Time(secs) = 0.010851
- Stephen Franceschell - C# Score = Time(secs) = 0.0113713
- Pedro Graca(Portugal) - C Score = Time(secs) = 0.014235
- Jure Potočnik(Slovenia,28) - C# Score = Time(secs) = 0.0271458
- klins(India,20) - C++ Score = Time(secs) = 0.0280809
- John Boyd/Christopher Lovejoy(USA) - C# Score = Time(secs) = 0.0288331
- Dennis Muhlestein(USA,31) - C++ Score = Time(secs) = 0.0424296
- Arturo Alatriste Trujillo(Mexico,32) - C Score = Time(secs) = 0.05455
- St0le(India) - C++ Score = Time(secs) = 0.120755
- Yanjiang QIAN(China) - C Score = Time(secs) = 0.198056
- Rafel Sytek(Poland) - C++ Score = Time(secs) = 0.53216
- St0le(India) - C++ Score = Time(secs) = 0.120755
- Vikas M. Ranjane(India,20) - C Score = Time(secs) = Stack Corrupted
More Programming Challenges
- Link to Rock, Scissors and Paper Bot Ongoing Programming Challenge - Runs weekly.
- Link to Programming Challenge 2 - Count the Islands. (Finished)
- Link to Programming Challenge 3 - Manage Elevators. (Finished)
- Link to Programming Challenge 4 - Guess the Mastermind Code - (Finished)
- Link to Programming Challenge 5 - Squeeze words into a crossword grid - (Finished)
- Link to Programming Challenge 6 - Guess the Mastermind Code - (Finished)
- Link to Programming Challenge 7 - Validate Chess Positions - (Finished)
- Link to Programming Challenge 8 - Score Poker Hands - (Finished)
- Link to Programming Challenge 9 - Manage a Data structure - (Finished)
- Link to Programming Challenge 10 - Hide Text (Finished)
- Link to Programming Challenge 11 - Match Sets of Cards (Finished)
- Link to Programming Challenge 12 - Calculate Shortest Path - Completed)
- Link to Programming Challenge 13 - Play Battleships (Finished)
- Link to Programming Challenge 14 - Multiply Large Numbers(Finished)
- Link to Programming Challenge 15 - Generate a Dungeon (Finished)
- Link to Programming Challenge 16 - Solve 1,000 Sliding Puzzles (Finished)
- Link to Programming Challenge 17 - Implement the Life Cellular Automaton (Finished)

