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 |
使用VC调试没有问题呀!可是提交了以后却报告说我的结果错误,谁能帮忙看看#include "stdio.h" #include "string.h" int main() { char sitelist[100][71]={""}; int nownum=0; char command[71]; strcpy(sitelist[nownum],"http://www.acm.org/"); for(;;) { memset(command,0,0); gets(command); if(!strncmp(command,"VISIT",5)) { nownum++; strcpy(sitelist[nownum],command+6); printf("%s\n",sitelist[nownum]); } else if(!strcmp(command,"BACK")) { nownum--; if(nownum>=0) { printf("%s\n",sitelist[nownum]); } else { nownum++; printf("%s\n","Ignored"); } } else if(!strcmp(command,"FORWARD")) { nownum++; if(nownum<=70 && strcmp(sitelist[nownum],"")) printf("%s\n",sitelist[nownum]); else { nownum--; printf("%s\n","Ignored"); } } else if(!strcmp(command,"QUIT")) { return 0; } else continue; } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator