用数组存储数据,遍历的方法很多,数组长度就是一组数据的个数。
至于用哪一种结构存储大数据,这倒没测试过
至于用哪一种结构存储大数据,这倒没测试过

思考赐予新生,时间在于定义
程序代码:
#include <iostream>
#include <vector>
using std::cout;
using std::cin;
using std::endl;
using std::vector;
int main(void)
{
vector<int> a;
int tmp = 0;
while (cin >> tmp)
{
a.push_back(tmp);
}
for (vector<int>::iterator i = a.end() - 1; i >= a.begin(); --i)
{
cout << *i << endl;
}
return 0;
}
