#include "stdafx.h"
#include <iostream>
#include<vector>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
vector <int> age;
bool flag = true;
while (flag)
{
int a;
cin >> a;
age.push_back(a);
if (a==100)
{
flag = false;
}
}
for (vector<int>::iterator it = age.begin(); it != age.end(); ++it)
{
cout << *it << endl;
}
while (true)
{
}
return 0;
} 目的是输入的数组可以事先不定数量。