zoukankan      html  css  js  c++  java
  • POJ 1028

    #include<iostream>
    using namespace std;
    #define Len     3
    #include<string>
    int main(){
       int i,d=1,index=0,box_max=0;
        string * pack=new string[Len];
        string * p;
        pack[0]="http://www.acm.org/";
        string comand_s=" ";
       do{
          cin>>comand_s;
      // cout<<comand_s<<endl;
       if(comand_s=="VISIT"){
           index++;
           cin>>pack[index];
           cout<<pack[index]<<endl;
               box_max=index;
           if(index==Len*d-2){
               d++;
             p=pack;
             pack=new string[Len*d];
             
             pack[0]=" ";
             for(i=0;i<Len*(d-1);i++){
                 swap(p[i],pack[i]);
                 
             }
             delete []p;//////////////////////////最后的调试
            // cout<<"------"<<endl;  这招挺管用的
           }
       }
       if(comand_s=="BACK"){
          index--;
          if(index==-1){
              cout<<"Ignored"<<endl;
              index++;
          }
          else
              cout<<pack[index]<<endl;
       }
       if(comand_s=="FORWARD"){
          index++;
          if(index>box_max){
              cout<<"Ignored"<<endl;
              index--;
          }
          else
              cout<<pack[index]<<endl;
       }
       if(comand_s=="QUIT")
           return 0;
       }while(1);
       return 0;
    
    }

    关注我的公众号,当然,如果你对Java, Scala, Python等技术经验,以及编程日记,感兴趣的话。 

    技术网站地址: vmfor.com




  • 相关阅读:
    MySQL 5.7.18 zip 文件安装过程
    Mysql 自定义随机字符串
    JAVA基本类型和引用类型
    初识JSP
    Java导出错误数据
    时序图的使用习惯
    Redis踩坑
    ES踩坑
    代码规范
    Git在公司的使用流程
  • 原文地址:https://www.cnblogs.com/gavinsp/p/4563218.html
Copyright © 2011-2022 走看看