as6757uyy65uy75
HippoSystem
2017-07-31 16:16

POJ 1028 一直Wrong answer....求助

  • poj
  • acm

题目在http://poj.org/problem?id=1028
我的代码如下:
#include
#include
#include
using namespace std;

int main()
{
unsigned current;
string userCommand;
vector webs;
webs.push_back("http://www.acm.org/");
while(getline(cin, userCommand))
{
if(userCommand.find("VISIT ") == 0)
{
webs.push_back(userCommand.substr(6));
current = webs.size() - 1;
cout << webs[current] << endl;
}
else if(userCommand == "BACK")
{
if(current == 0)
cout << "Ignored" << endl;
else
cout << webs[--current] << endl;
}
else if(userCommand == "FORWARD")
{
if(current == webs.size() - 1)
cout << "Ignored" << endl;
else
cout << webs[++current] << endl;
}
else if(userCommand == "QUIT")
break;
}

return 0;

}

求大神们帮我看看好不。。。。非常感谢

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答

为你推荐

换一换