📄 1337.cpp
字号:
/* This Code is Submitted by wywcgs for Problem 1337 on 2005-03-23 at 14:01:14 */
#include <stdio.h>
#include <string.h>
int main()
{
char back[100][72], forward[100][72], current[72], command[10];
int backP = 0, forP = 0;
strcpy(current, "http://www.acm.org/");
while(scanf("%s", command) == 1){
if(!strcmp(command, "QUIT")){
return 0;
}else if(!strcmp(command, "FORWARD")){
if(forP != 0){
printf("%s\n", forward[--forP]);
strcpy(back[backP++], current);
strcpy(current, forward[forP]);
}else{
printf("Ignored\n");
}
}else if(!strcmp(command, "BACK")){
if(backP != 0){
printf("%s\n", back[--backP]);
strcpy(forward[forP++], current);
strcpy(current, back[backP]);
}else{
printf("Ignored\n");
}
}else if(!strcmp(command, "VISIT")){
strcpy(back[backP++], current);
scanf("%s", current);
printf("%s\n", current);
forP = 0;
}
}
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -