📄 1828124_ac_30ms_212k.c
字号:
# include <stdio.h>
# include <string.h>
void main()
{
int i, j, mark;
char url[80], current[80], act[20], ba[1000][100], fw[1000][100];
strcpy(current,"http://www.acm.org/");
i = j = 0;
while(1)
{
mark = 0;
scanf("%s",act);
if(strcmp(act,"QUIT") == 0) break;
if(strcmp(act,"VISIT") == 0)
{
scanf("%s",url);
strcpy(ba[++i],current);
strcpy(current,url);
j = 0;
}
if(strcmp(act,"BACK") == 0)
{
if(i > 0)
{strcpy(fw[++j],current);strcpy(current,ba[i--]);}
else mark = 1;
}
if(strcmp(act,"FORWARD") == 0)
{
if(j <= 0)
mark = 1;
else
{strcpy(ba[++i],current);strcpy(current,fw[j--]);}
}
if(mark) printf("Ignored\n");
else puts(current);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -