#include<iostream>
#include<string>
using namespace std;
int main()
{
string websites[102];
websites[1] = "http://www.acm.org/";
string str,tmp;
int i = 1,max;
while(cin>>str && (str[0] != 'Q')){
if(str[0] == 'V')
{
cin>>tmp;
websites[++i] = tmp;
max = i;
cout<<tmp<<endl;
}
else if(str[0] == 'B'){
if(i>1){
cout<<websites[--i]<<endl;
}
else{
cout<<"Ignored"<<endl;
}
}
else if(str[0] == 'F'){
if(i >= max){
cout<<"Ignored"<<endl;
}else{
cout<<websites[++i]<<endl;
}
}
}
}
POJ1028
最新推荐文章于 2022-12-21 21:07:25 发布