求怎么解不输出末尾0
查看原帖
求怎么解不输出末尾0
1012089
free35楼主2024/5/16 20:40
#include<bits/stdc++.h>
using namespace std;
int main(){
	stack<int> b;
	int a=1;
	do{
		cin>>a;
		b.push(a);
	}while(a!=0);
	while(1){
		if(b.size()<0){
			break;
		}
		cout<<b.top()<<' ';
		b.pop();
		
	}
	return 0;
}
2024/5/16 20:40
加载中...