📄 chapter8-12.cpp
字号:
//文件名:CHAPTER8-12.cpp
#include <iostream>
#include <list>
#if _MSC_VER > 1020 // if VC++ version is > 4.2
using namespace std; // std c++ libs implemented in std
#endif
int main( )
{ list <int> c1;
c1.push_back( 10 );
c1.push_back( 20 );
c1.push_back( 30 );
c1.resize( 4,40 );
cout << "The size of c1 is " << c1.size( ) << endl;
cout << "The value of the last element is " << c1.back( ) << endl;
c1.resize( 5 );
cout << "The size of c1 is now " << c1.size( ) << endl;
cout << "The value of the last element is now " << c1.back( ) << endl;
c1.resize( 2 );
cout << "The reduced size of c1 is: " << c1.size( ) << endl;
cout << "The value of the last element is now " << c1.back( ) << endl;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -