POJ-1028-Web Navigation
来源:互联网 发布:dota视频软件 编辑:程序博客网 时间:2024/05/16 12:54
比较简单的一个模拟题,根据实际浏览器的操作来做
代码:
#include<cstdio>#include<cstring>#include<iostream>using namespace std;const int maxn=101;char str[maxn][maxn];int main(){ strcpy(str[0],"http://www.acm.org/"); int cnt=0,now=0; char op[20]; while(scanf("%s",op)!=EOF) {if(!strcmp(op,"QUIT")) break;if(!strcmp(op,"VISIT")){ cnt=now; scanf("%s",str[++cnt]); now=cnt; printf("%s\n",str[now]);}else if(!strcmp(op,"BACK")){ now--; if(now<0) {printf("Ignored\n");now=0; } elseprintf("%s\n",str[now]);}else{ now++; if(now>cnt) {printf("Ignored\n");now=cnt; } elseprintf("%s\n",str[now]);} } return 0;}
- POJ 1028 Web Navigation
- POJ 1028 Web Navigation
- poj 1028 Web Navigation
- Web Navigation poj 1028
- poj 1028 Web Navigation
- POJ-1028-Web Navigation
- poj 1028 Web Navigation
- poj-1028 Web Navigation
- POJ 1028 Web Navigation
- poj 1028 Web Navigation
- POJ 1028 Web Navigation
- POJ 1028 - Web Navigation
- POJ 1028 Web Navigation
- poj 1028 Web Navigation
- POJ 1028 Web Navigation
- POJ 1028 - Web Navigation
- POJ 1028----Web Navigation
- poj 1028-Web Navigation
- linux内核List中关于hash链表
- POJ-1008-Maya Calendar
- WPF整理
- 获取URL中的中文参数
- 冒泡排序
- POJ-1028-Web Navigation
- linux内核list.h中对链表的操作
- POJ-1051-P,MTHBGWB
- DispatcherServlet作用
- Linux中的container_of的说明
- POJ-1666-Candy Sharing Game
- MAVEN常用命令
- linux内核中typeof的使用说明
- WCF把书读薄(3)——数据契约、消息契约与错误契约