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

  1. 1
    Your First Program and Output

    Write your first C++ program and print text to the screen.

  2. 2
    Variables and Data Types

    Variables, the int, long long, double, char and bool types, arithmetic and integer division.

  3. 3
    Reading Input

    Reading numbers and words from standard input with std::cin.

    1 problems

  4. 4
    Conditional Statements

    The if/else statement, comparisons and the && and || logical connectives.

    1 problems

  5. 5
    Loops

    The for and while loops: repeating actions, counters and accumulating a result.

    2 problems

  6. 6
    Arrays and Vectors

    std::vector — an array: reading n elements, traversing and finding the maximum.

    1 problems

  7. 7
    Strings

    std::string: length, character access, traversal and a palindrome check.

    3 problems

  8. 8
    Functions

    Functions: parameters, return values and decomposing a solution.

    2 problems

  9. 9
    The STL Standard Library

    The STL: sort, pairs, set and map — tools that save you hours.

  10. 10
    Contest Setup: Fast I/O and Template

    Fast input/output, a solution template and the C++ competitor's checklist.

Доска