讨论 / 输出FORWARD也是个人才
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;

}

}

}

}

#1 ZWJZWJ@2024-06-05 06:38:44
回复 删除
SID1253528
#2 ZWJZWJ@2024-06-05 07:12:09
回复 删除
数组超限导致的
查看更多回复
提交回复