Skip to content

DinhThienPhuc/project-euler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project Euler Solutions

A collection of solutions for Project Euler problems implemented in C/C++ programming languages.

Overview

This application provides algorithmic solutions to Project Euler mathematical/programming problems using:

  • C/C++

Project Structure

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

Getting Started

Prerequisites

  • C++ compiler (GCC recommended)

Creating New Solutions

  1. Generate problem template:
# Example: ./create-problem.sh 0001 MULTIPLES_OF_3_AND_5
./create-problem.sh <number> <name>
  1. Implement the answer in problems/<number>/answer.cpp
  2. Run and test solution:
# Example: ./run.sh problems/0001
./run.sh problems/<number>
  1. Submit result to Project Euler website for checking
  2. Copy and paste the overview.pdf file for best answer
  3. Implement the solution in problems/<number>/solution.cpp
  4. Run the command below for testing answer. If any test does not pass, fix the answer
  5. Re-compile and run answer using run.sh file
  6. Check the answer and self-study for better knowledge

Development Workflow

  1. Problem Definition
  • Define problem requirements in input.h
  1. Implement
  • Write C++ solution in solution.cpp
  1. Verification
  • Compare with Project Euler website
  • Document optimal solution

License

MIT

Author

@DinhThienPhuc

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published