ZWJZWJ 2024-06-05 21:37:52
点我顶贴
收藏
删除
#include<bits/stdc++.h>
using namespace std;
int main(){
string s[100],a;
int n=0,m=0;
s[0]="http://www.acm.org/";
while(a!="QUIT"){
cin>>a;
if(a=="VISIT"){
n++;
cin>>s[n];
cout<<s[n]<<endl;
m=n;
}
if(a=="FORWARD"){
if(n<m){
n++;
cout<<s[n]<<endl;
}else{
cout<<"Ignored"<<endl;
}
}
if(a=="BACK"){
if(n>0){
n--;
cout<<s[n]<<endl;
}else{
cout<<"Ignored"<<endl;
}
}
}
}