用vector容器:
//---------------------------------------------------------------------------
#include
#include
using namespace std;
int main(void)
{
vector
int x=-1;
while (x)
{
cin>>x;
if (x) {
arr.push_back(x);
}
}
for ( vector
cout<
return 0;
}
//---------------------------------------------------------------------------