Skip to content

patrick333/euler-project-solutions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Origin

Before the winter of 2013, I ran in the website of Euler Project and was amazed at the idea of solving common mathematical problems (often problems related to numbers, permutation and combination). I am not particularlly interesting in mathematics, but I spent weeks on it because the joy of solving problems was so great.

To make programming with mathematics less boring, I tried to utilize different programming languages: c++, c#; java; python, php, ruby. Sometimes, I solved the same problem with more than one language, or more with more than one way.

How to run

c++

http://stackoverflow.com/questions/221185/how-to-run-c-c-in-a-unix-console-mac-terminal

c#

on windows cli, run:

$csc solution.cs

you will get a solution.exe. Then, run

$solution

php

on your cli, run:

$php solution.php

java

$javac solution.java

$java solution

ruby

$ruby solution.rb

python

$python solution.py

Performance of different languages

Try to solve the same mathematical problems in different programming languages, you can see the differences of execution are enormous.

For example, it became obvious to me that some languages specializing in web development, such as php, ruby, are slower in executing CPU and memory intensive programs, than other more general-purpose languages (c++,c#, python,java). Sometimes, it is simply not possible to get a result in a reasonable time scope.

About

euler project solutions in python, c++, c#, java, php, ruby

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published