Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

为什么WA 啊!哪位高手告诉我一下!

Posted by zx191052 at 2006-09-09 19:39:26 on Problem 1028
#include "stdio.h"
#include "string.h"
int main()
{
    char a[101][71],b[7];    
    int m,i,k;
    strcpy(a[0],"http://www.acm.org/");
    m=0;
    i=0;
    while(scanf("%s",b)!=EOF)
    {
        if(b[0]=='V')
        {            
            i=m+1;
            scanf("%s",a[i]);
            printf("%s\n",a[i]);
            m=i;
            k=i+1;
            for(;k<101;k++)
            a[k][0]=0;
        }
        else if(b[0]=='B')
        {
            m--;
            if(m<0) {printf("Ignored\n");m++;}
            else printf("%s\n",a[m]);
        }
        else if(b[0]=='F')
        {
            m++;
            if(a[m][0]=='h'&&m<70) printf("%s\n",a[m]);
            else {printf("Ignored\n");m--;}
        }
        else if(b[0]=='Q') break;
    }
    return 0;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator