for(int i = 0;i < n;i++){
if(i == 0){
cout << a[i];
} else{
cout << " " << a[i];
}
}
或
for(int i = 0;i < n;i++){
if(i == 0){
printf("%d",a[i]);
} else{
printf(" %d",a[i]);
}
}
C/C++去除行末空格
猜你喜欢
转载自blog.csdn.net/weixin_45019478/article/details/104563778
今日推荐
周排行