| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
HELP!! CEAZY!!!#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator