| ||||||||||
| 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 | |||||||||
注意!BACK和FORWARD都要Ignored,附代码#include<stdio.h>
#include<string.h>
int main()
{
char a[105][80],w[10],top,temp;
strcpy(a[1],"http://www.acm.org/");
scanf("%s",w);
top=temp=1;
while(strcmp(w,"QUIT")){
if(!strcmp(w,"VISIT")){
top=temp;
top++;
temp=top;
scanf("%s",a[top]);
printf("%s\n",a[top]);
}
if(!strcmp(w,"BACK")){
if(temp-1>0)
temp--,printf("%s\n",a[temp]);
else
printf("Ignored\n");
}
if(!strcmp(w,"FORWARD")){
if(temp+1<=top){
temp++;
printf("%s\n",a[temp]);
}
else
printf("Ignored\n");
}
scanf("%s",w);
}
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator