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<stdlib.h> int fun(const void *a,const void *b) { return *(char *)a-*(char *)b; } char a[100001][11],b[100001][11],c[11]; int main() { int i,j,k,m,n,len; i=1; while(1) { scanf("%s%s",a[i],b[i]); if(a[i][0]=='\n')break; len=strlen(b[i]); qsort(b[i],len,sizeof(char),fun); i++; } k=i-1; while(scanf("%s",c)!=EOF) { len=strlen(c); qsort(c,len,sizeof(char),fun); printf("%s",c); for(i=1;i<=k;i++) { if(strcmp(c,b[i])==0){printf("%s\n",a[i]);break;} } if(i==k+1){printf("eh\n");} } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator