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 |
附代码,0MS#include<stdio.h> #include<string.h> char a[100]; char b[200][200]; int main() { int i,j=0; strcpy(b[0],"http://www.acm.org/"); while(1) { scanf("%s",a); if(strcmp(a,"QUIT")==0)break; if(strcmp(a,"VISIT")==0) { scanf("%s",b[++j]);i=j; } if(strcmp(a,"BACK")==0)j--; else if(strcmp(a,"FORWARD")==0)j++; if(j<0){j++;printf("Ignored\n");} else if(j>i){j--;printf("Ignored\n");} else printf("%s\n",b[j]); } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator