|
|
back to boardPlease,expl me my mistake-why WA2 I submitted this problem many times and got WA2 See my code in C: int main() { gets(et); en=0; while (a[i-1][j-1]!='#') { j=0; while ((c=getc(stdin))!=10) { if (c=='-') { i++; j=0; continue; } if (c=='#') break; if (c==10||c==13) continue; a[i][j]=c; j++; //temp=getc(stdin); } if (c=='#') break; i++; if (a[i-1][j-1]=='#') { break;} //cout<<i<<endl; } //for (i=0;i<5;i++) // printf("%s",a[i]) ; // return 0; //}
en=k=i; for (i=0;i<k;i++) { if (e[i]==0) { e[i]=1; for (j=i+1;j<=k;j++) { if (strcmp(a[i],a[j])==0) { e[j]=1; en--; } } } } printf("%d\n",en-1); return 0; }
|
|
|