`
EmmaZhao
  • 浏览: 32293 次
  • 性别: Icon_minigender_2
  • 来自: 北京
最近访客 更多访客>>
社区版块
存档分类
最新评论

POJ1028

 
阅读更多
#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;
			}
		}
	}
}
分享到:
评论

相关推荐

    poj-1028-Web-Navigation.zip_poj

    poj 1028 Web Navigation 的代码,已通过!

    北大POJ部分题目答案(一些基础题目)

    很多的POJ题目答案!1000~1008,1011~1014,1016,1017,1019,1028,1032,1045,1046,1047,1050,1061,1067,1068,1088,1102,1159,1163,1183,1207,1218,1226,1247,1256,1258,1298,1316,1323,...

    POJ PKU 必做题+部分难题1001-2500

    1011,1012,1013,1014,1015,1017,1026,1028,1032,1035,1041,1046,1129 1149 1154 1165 1182 1185 1190 1191 1201 1251 1273 1275 1276 1286 1322 1338 1363 1364 1401 1456 1459 1564 1579 1637 1657 1658 ...

    poj ac题目代码

    1000 1003 1004 1005 1006 1008 1012 1028 1036 1045 1046 1047 1087 1163 1183 1207 1218 1247 1269 1298 1306 1316 1326 1331 1338 1401 1423 1450 1455 1477 1488 1503 1504 1517 1519 1528 1543 1547 1552 1555 ...

    poj100题解。具体题号见说明

    1000 1002 1003 1004 1005 1006 1007 1008 1011 1012 1013 1019 1028 1045 1046 1068 1080 1088 1163 1207 1218 1256 1298 1299 1316 1326 1401 1455 1477 1488 1503 1504 1517 1519 1547 1552 1565 1579 1607 1656 ...

    acm poj 源代码

    1001 1002 1003 1004 1005 1006 1007 1008 1011 1012 1013 1014 1015 1017 1018 1019 1028 1032 1042 1046 1050 1061 1065 1066 1067 1077 1080 1083 1088 1094 1111 1125 1135 1141 1157 1160 1161 1163 1166 1170 ...

    poj pku 解题报告

    1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1011 1012 1013 1014 1015 1017 1018 1019 1028 1032 1035 1040 1042 1045 1046 1047 1050 1056 1061 1062 1063 1065 1067 1068 1080 1083 1088 1089 1091 1094 ...

    poj135道题的代码

    1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1011 1012 1013 1014 1018 1019 1028 1032 1040 1042 1045 1046 1047 1050 1056 1061 1062 1063 1065 1067 1068 1083 1088 1102 1113 1118 1126 1141 1142 1157 ...

    ABC.zip_2262_ABC

    POJ 1006 1017 1028 1799 2262源码 简单的算法

    PKU源码。。。。。

    PKU,POJ共301题源代码。1001 1002 1003 1004 1005 1006 1007 1008 1011 1012 1013 1014 1015 1017 1018 1019 1028 1032 1042 1046 1050 1061 1065

Global site tag (gtag.js) - Google Analytics