C++ from Scratch
C++ is the main language of competitive programming. This course takes you from your first program to confident use of the language and the STL.
In this section
- 1Your First Program and Output
Write your first C++ program and print text to the screen.
- 2Variables and Data Types
Variables, the int, long long, double, char and bool types, arithmetic and integer division.
- 3Reading Input
Reading numbers and words from standard input with std::cin.
1 problems
- 4Conditional Statements
The if/else statement, comparisons and the && and || logical connectives.
1 problems
- 5Loops
The for and while loops: repeating actions, counters and accumulating a result.
2 problems
- 6Arrays and Vectors
std::vector — an array: reading n elements, traversing and finding the maximum.
1 problems
- 7Strings
std::string: length, character access, traversal and a palindrome check.
3 problems
- 8Functions
Functions: parameters, return values and decomposing a solution.
2 problems
- 9The STL Standard Library
The STL: sort, pairs, set and map — tools that save you hours.
- 10Contest Setup: Fast I/O and Template
Fast input/output, a solution template and the C++ competitor's checklist.