help!!!!!!
查看原帖
help!!!!!!
1128414
ptb15楼主2023/10/7 19:00
#include<bits/stdc++.h>
using namespace std;

stack <unsigned long long> s;
unsigned long long i, n, x, opt, T, len;
string st;

int main() {
	cin >> T;
	while (T--) {
		cin >> n;
		len = 0;
		for (i = 1; i <= n; i++) {
			cin >> st;
			if (st == "push") {
				cin >> x;
				s.push(x);
				len++;
			}
			if (st == "size") {
				cout << len << endl;
			}
			if (st == "pop") {
				if (s.empty()) {
					cout << "Empty" << endl;
				} else {

为什么33?

2023/10/7 19:00
加载中...