std::list<int>test
int a = 1
while (1)
{
std::cout <<"请输入数字,退出输入请按0" <<std::endl
std::cin >>a
if(a == 0)
break
test.push_back(a)
}
std::list<int>::iterator it = test.begin()
while(it!= test.end())
{
std::cout <<*it++ <<std::endl
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)