⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 1337.cpp

📁 这是哈尔滨工业大学acmOJ的源代码
💻 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 + -