Quickstart
This is the fastest path from zero to a working algo program.
What algo is
Section titled “What algo is”algo is a competitive programming language that compiles to readable C++17.
The workflow is:
- Write
input.alg - Optionally run
./algo format input.alg - Run
./algo compile input.alg -o output.cpp - Compile the generated C++ with
g++ - Run or submit the result
Prerequisites
Section titled “Prerequisites”- A POSIX shell for the
./algowrapper - JDK 17 or newer
g++with C++17 support
On Ubuntu or Debian:
sudo apt install openjdk-17-jdk g++Get the repo
Section titled “Get the repo”git clone https://github.com/jiupr/algo.gitcd algoCompile your first program
Section titled “Compile your first program”Create aplusb.alg:
input: a, b: intprintln a + bCompile it:
./algo format aplusb.alg -o aplusb.alg./algo compile aplusb.alg -o aplusb.cppg++ -std=c++17 -O2 aplusb.cpp -o aplusbRun it:
echo "3 4" | ./aplusbOutput:
7Read next
Section titled “Read next”- Your first algo program for a short language walkthrough
- Solving a real problem for a fuller example
- Syntax reference when you need exact forms