POJ 1028(简单的模拟浏览器)
来源:互联网 发布:多益网络的手游 编辑:程序博客网 时间:2024/05/24 02:54
#include<iostream>#include<string>#include<cstring>#include<stack>using namespace std;stack <string> sta,temp;char str[8]="VISTT";int main(){sta.push("http://www.acm.org/");string url;while(1){scanf("%s",str);switch(str[0]){case 'Q':return 0;case 'V':while(temp.size()) temp.pop();cin>>url;sta.push(url);cout<<sta.top()<<endl;break;case 'B':if(sta.size()>1){temp.push(sta.top());sta.pop();cout<<sta.top()<<endl;}elseprintf("Ignored\n");break;case 'F':if(temp.size()>0){sta.push(temp.top());temp.pop();cout<<sta.top()<<endl;}elseprintf("Ignored\n");break;default:break;}}return 0;}
这个题:要注意的地方,也就是逻辑错误:
当VISIT时,你的FORWARD的栈要清空,因为要重新访问了一个网页。
阅读全文
0 0
- POJ 1028(简单的模拟浏览器)
- POJ 1028 用栈模拟浏览器的前进与后退
- POJ 1028 用栈模拟浏览器的前进与后退
- POJ 1028 Web Navigation(简单模拟)
- IOS手机模拟简单的浏览器
- 简单模拟浏览器的解析功能
- poj 1281 MANAGER(简单模拟题)
- POJ 1132 Border(边界) 简单模拟
- poj 2190 简单模拟(ISBN)
- POJ 2000 Gold Coins(简单模拟)
- poj 2509 简单模拟(烟屁换烟)
- POJ 1250 Tanning Salon(简单模拟)
- POJ 3414 Pots(简单模拟+dfs)
- POJ 2897 Dramatic Multiplications(简单模拟)
- POJ 2632 Crashing Robots(简单模拟)
- POJ 2105 IP Address(简单模拟)
- POJ 3087 (简单map + 模拟)
- POJ 2453 简单模拟
- Android系统源码Build系统入门详解
- ABBYY自动化文档处理是如何节省时间的
- 库存压死人?从库存产生的原因教你认清这个“万恶之源”
- android中SELINUX规则分析和语法简介
- Python各种下载包的地址
- POJ 1028(简单的模拟浏览器)
- web测试方法总结
- Android Studio打包以及Gradle配置构建
- word 中简单插入美观的代码
- 基于CentOS7将Java应用生成docker镜像
- Excel-VBA: 复选框CheckBox是否选中
- 84、java的IO操作-转化流
- HDU 4946 Area of Mushroom(凸包)
- Hdu 4089 Activation 概率DP