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

3. Where next

To run programs locally, see Getting started & CLI.