编译不通过不知哪里出了问题 请大佬们请指点迷津
//编写程序获取vector容器的第一个元素,分别使用下标操作符,front函数以及begin函数实现该功能,并提供空的vector容器测试你的程序#include<iostream>
#include<vector>
using namespace std;
int main(void)
{
cout<<"\tInput some int numbers to a vector(Ctrl+Z to end):"<<endl;
vector<int> ivec;
int i;
while(cin>>i)
{
ivec.push_back(i);
}
if(!ivec.empty())
{
cout<<"The first elements of the vector is:";
cout<<"\n\t==>>Using front():\t"<<ivec.front();
cout<<"\n\t==>>Using begin():\t"<<ivec.begin();
cout<<"\n\t==>>Using ivec[0]:\t"<<ivec[0];
cout<<"\n\t==>>Using ivec.at(0):\t"<<ivec.at(0)<<endl;
}
system("pause");
return 0;
}