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 ++ remove the end of the line spaces
Guess you like
Origin blog.csdn.net/weixin_45019478/article/details/104563778
Recommended
Ranking