| ||||||||||
| 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>
int main()
{
static char a[102][72]={{"http://www.acm.org/"}},b[8];
int i,j;
for(i=0;;)
{
scanf("%s",b);
if(*b=='Q')
break;
else if(*b=='V')
{
i++;
scanf("%s",a[i]);
printf("%s\n",a[i]);
for(j=i+1;j<102;j++)
*a[j]=0;
}
else if(*b=='B')
{
i--;
if(i>=0)
printf("%s\n",a[i]);
else {i++;
printf("Ignored\n");
}
}
else if(*b=='F')
{
i++;
if(*a[i]!='\0')
printf("%s\n",a[i]);
else printf("Ignored\n");
}
}
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator