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 |
Re:样例都过来,代码如下,可就是wa....大牛请指教In Reply To:样例都过来 Posted by:dong930 at 2007-08-01 15:12:42 #include<stdio.h> #include<string.h> main() { int n,i,j,k,t=0,len,blank=0,ci=0; char s[1005][10]; while(scanf("%d",&n) && n) { for(i=1;i<=n;i++) scanf("%s",s[i]); scanf("%s",s[0]); len=strlen(s[0]); for(k=0;k<len;k++) if(s[0][k]='_')blank++; for(i=1;i<=n;i++) { for(j=0;j<len;j++) for(k=0;s[i][k]!='\0';k++) if(s[0][j]==s[i][k]){s[i][k]='.';ci++;break;} if(k<=ci+blank)t++; ci=0; } printf("%d\n",t); t=blank=0; } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator