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<iostream> using namespace std; int main() { int n,cnt,i,j,k,count,len,len1,ext; char p[1000][8],b[8]; while(1) { cnt=0; cin>>n; getchar(); if(!n) break; for(i=0;i<n;i++) { gets(p[i]); } gets(b); len=strlen(b); for(i=0;i<n;i++) { ext=0; count=0; len1=strlen(p[i]); if(len1>len) continue; for(j=0;j<len;j++) { if(b[j]=='_') { ext++; continue; } for(k=0;k<len1;k++) { if(p[i][k]=='\0') continue; if(b[j]==p[i][k]) { count++; p[i][k]='\0'; } } } if(count+ext>=len1) { cnt++; continue; } } printf("%d\n",cnt); } return 1; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator