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() { int count=0,max; char str[100][70]; char cmd[12],get[80]; strcpy(str[0],"http://www.acm.org/"); while(scanf("%s",cmd)) { if(cmd[0]=='Q') break; if(cmd[0]=='V') { getchar(); gets(get); count++; max=0; if(count>max) max=count; strcpy(str[count],get); printf("%s\n",str[count]); } if(cmd[0]=='B') { count--; if(count>=0){ printf("%s\n",str[count]); } else { printf("Ignored\n"); count++; } } if(cmd[0]=='F') { count++; if(max>=count) { printf("%s\n",str[count]); } else { printf("Ignored\n"); count--; } } } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator