Getting started · 5 minutes
Your first program
CP Lang is a language for competitive programming. Each program compiles to one C++17 file that you submit to any judge. This page runs the same compiler in your browser.
1. Run it
The program reads n, then n numbers, and prints their sum. Press Run, then open the C++17 tab to see the file you would submit, with your source quoted at the top.
Output
Press Run (Ctrl+Enter).
2. Break it on purpose
- In the Input box, change the first
5to6. The run stops and names the line that expected six numbers. - Change
a.sum()toa.summ(). The error appears as you type and suggestssum. - Change
1..=2e5to1..=3and run. Input outside the range traps instead of being silently accepted.
3. Where next
Quickstart for your language
C++, Python, Java or Rust: six problems side by side.
Learn
Chapters to read, and practice problems judged in your browser.
The tour
The whole language in one sitting.
To run programs locally, see Getting started & CLI.