Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

HELP!! CEAZY!!!

Posted by tianshi at 2006-08-08 11:50:30 on Problem 1028
#include<stdio.h>
#include<string.h>
#define pr printf
int main()
{
 int i,j,k,l,m,n;
 char a[120][120],b[10];
 for(i=0;i<=120;i++)
   strcpy(a[i],"0");
 strcpy(a[2],"http://www.acm.org/");
 i=2;
 while(1)
  {
   scanf("%s",b);if(strcmp(b,"QUIT")==0) break;
   else if(strcmp(b,"VISIT")==0) 
     {i++;scanf("%s",a[i]);pr("%s\n",a[i]);}
   else if(strcmp(b,"BACK")==0)
     {i-=1;if(strcmp(a[i],"0")!=0) pr("%s\n",a[i]);
      else { pr("Ignored\n");i=2;}
     }
   else if(strcmp(b,"FORWARD")==0)
     {i+=1;if(strcmp(a[i],"0")!=0) pr("%s\n",a[i]);
      else  {pr("Ignored\n");i-=1;}
     }
  }    
}
    

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator