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 |
求各位大侠们帮助,我这代码意思很简单明确啊,为什么总是WA!!!!#include"stdio.h" #include"string.h" int main() { char url[200][100],a[10];int i; i=0; memset(url,'a',sizeof(url)); strcpy(url[0],"http://www.acm.org/"); while(1) { scanf("%s",a); if(strcmp(a,"VISIT")==0) { i++; scanf("%s",url[i]); printf("%s\n",url[i]); } if(strcmp(a,"BACK")==0) { i--; if(i>=0) printf("%s\n",url[i]); else printf("Ignored\n"); if(i<0) i=0; } if(strcmp(a,"FORWARD")==0) { i++; if(url[i][0]!='a') printf("%s\n",url[i]); else { printf("Ignored\n"); i--; } } if(strcmp(a,"QUIT")==0) break; } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator