| ||||||||||
| 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 <stdio.h>
#include <string.h>
main()
{ int j,n,i,m[1000],max[1000],result[1000],c;
char a[200][200];
scanf("%d",&n);
for(i=0;i<n;i++)
{ scanf("%d",&m[i]);
scanf("%s",a[0]);
max[i]=strlen(a[0]);
for(j=1;j<m[i];j++)
{ scanf("%s",a[j]);
c=strlen(a[j]);
if(c>max[i])
{ max[i]=c;result[i]=j;}
}
}
for(i=0;i<n;i++)
printf("%d\n",result[i]+1);
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator