A collection of solutions for Project Euler problems implemented in C/C++ programming languages.
This application provides algorithmic solutions to Project Euler mathematical/programming problems using:
- C/C++
project-euler/
├── problems/ # Individual problem solutions
│ └── 0001/ # Problem folders
│ ├── answer.cpp # C/C++ implementation
│ ├── input.h # C/C++ problem definition
│ ├── overview.pdf # Solution explanation
│ └── solution.cpp # C/C++ solution
├── helpers/ # Shared utility functions
├── create-problem.sh # SCript to quick template a problem
└── run.sh # SCript to run problem's answer and solution
- C++ compiler (GCC recommended)
- Generate problem template:
# Example: ./create-problem.sh 0001 MULTIPLES_OF_3_AND_5
./create-problem.sh <number> <name>
- Implement the answer in
problems/<number>/answer.cpp
- Run and test solution:
# Example: ./run.sh problems/0001
./run.sh problems/<number>
- Submit result to Project Euler website for checking
- Copy and paste the overview.pdf file for best answer
- Implement the solution in
problems/<number>/solution.cpp
- Run the command below for testing answer. If any test does not pass, fix the answer
- Re-compile and run answer using
run.sh
file - Check the answer and self-study for better knowledge
- Problem Definition
- Define problem requirements in input.h
- Implement
- Write C++ solution in solution.cpp
- Verification
- Compare with Project Euler website
- Document optimal solution
MIT
@DinhThienPhuc