📄 pr24002.cpp
字号:
////////////////////////////////////////
// File Name: pr24002.cpp
////////////////////////////////////////
#include <iostream>
#include <vector>
int main()
{
// Create a vector object.
std::vector<int> intVector(5);
// Populate the vector.
std::vector<int>::iterator out = intVector.begin();
*out++ = 10;
*out++ = 15;
*out++ = 20;
*out++ = 25;
*out = 30;
// Display the contents of the vector.
std::cout << "Contents of the vector: " << std::endl;
std::vector<int>::iterator it = intVector.begin();
while (it != intVector.end())
{
std::cout << *it << std::endl;
++it;
}
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -