C++ · ОСНОВЫ · LESSON 15
Add to the list
push_back · about 12 minutes
Learning with progressRead the summary for free. To save the work, log in to the account.
Type the code yourself
Manually type the program from the sample. So you'll remember commands and brackets.
#include <iostream>
#include <vector>
using namespace std;
int main() {
vector<int> nums = {1, 2};
nums.push_back(3);
cout << nums.size() << endl;
return 0;
}Open the editor for class workSolve it yourself
Создай vector<int> nums из 1 и 2. Добавь 3 и 4 через push_back, затем выведи размер.
The answer is hidden. Use similar examples from the lesson notes.
Opening up your homework