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 |
谁帮我看看一直,Runtime Error..............#include <stdio.h> #include <string.h> #include <windows.h> #define MAXN 101 #define MINN 51 #define elem_t char elem_t arr[MAXN][MAXN]; elem_t arr1[MINN][MINN]; int N,M,T,P,Q; int TestArr() { int i,j,k,num=0; for (i=0;i<=N-P;i++) { for(j=0;j<=M-Q;j++) { for (k=0;k<P;k++) { if(strncmp(arr[i+k]+j,arr1[k],Q)) break; } if(k==P) num++; } } return num; } int main() { int i,j=1,num; //long start = GetTickCount(); //freopen("in.txt","r",stdin); //freopen("out.txt","w",stdout); while (scanf("%d%d%d%d%d%*c",&N,&M,&T,&P,&Q)) { if(N==0||M==0||P==0||Q==0||T==0)break; for(i=0;i<N;i++) { memset(arr[i],0,M+1); } for(i=0;i<P;i++) { memset(arr1[i],0,Q+1); } for(i=0;i<N;i++) { scanf("%s",arr[i]); } num=0; while(T--) { for (i=0;i<P;i++) { scanf("%s",arr1[i]); } num += TestArr(); } printf("Case %d: %d\n",j++,num); } //printf("%d ms\n",GetTickCount()-start); return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator