C++'s solution to inserting a linear table at the end without outputting spaces:
for(i=0;i<n;i++){
//此处末尾会多输出一个空格
//cout<<s.elem[i]<<" ";
//解决:第一个数不加空格,后面的数在前面加空格
if(i==0)
cout<<s.elem[i];
else{
cout<<" "<<s.elem[i];
}
}