#include <bits/stdc++.h>
using namespace std;
queue<string> q; 
int main(){
    char a;
    string b;
    while(cin>>a)
    {
        if(a=='A')
        {
            if(!q.empty())
            {
                cout<<"-"<<q.front()<<endl;
                q.pop();
            }
            else{
                cout<<"-None"<<endl;
            }
        }
         if(a=='B')
        {
            cin>>b;
            q.push(b);
        }
    }	
	return 0;
}	

0 条评论

目前还没有评论...

信息

ID
657
时间
1000ms
内存
256MiB
难度
4
标签
递交数
256
已通过
76
上传者