33pts求助
查看原帖
33pts求助
658719
ETO_listener楼主2024/7/5 15:31
#include<bits/stdc++.h>
#define ull unsigned long long
using namespace std;
stack<ull> a;
int main(){
	
	char doing[6];
	int num;
	int n,m;
	cin>>n;
	for(int i=0;i<n;i++){
		while(1)
		{
			if(a.empty())
				break;
			a.pop();
		}
		cin>>m;
		for(int j=0;j<m;j++){
			scanf("%s",doing);
			if(doing[0]=='q'){
				if(a.empty()){
					cout<<"Anguei!"<<endl;
					//TODO
				}
				else{
					cout<<a.top()<<endl;
				}
				//TODO
			}
			else if(doing[0]=='s'){
				cout<<a.size()<<endl;
				//TODO
			}
			else{
				if(doing[1]=='o'){
					if(a.empty())
					{
						cout<<"Empty"<<endl;
					}
					else
					{
						a.pop();
					}
					//TODO
				}
				else
				{
					cin>>num;
					a.push(num);
				}
			}
			//TODO
		}
		//TODO
	}
}

AC#1
WA#2:Wrong Answer.wrong answer On line 2 column 1, read 4, expected 2.
WA#3:Wrong Answer.wrong answer On line 1 column 1, read 2, expected 1.

2024/7/5 15:31
加载中...