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 |
太多循环In Reply To:帮我看看为什么RUNTIME ERROR!! Posted by:13lazyrainy at 2007-05-27 10:15:04 for (k=0;k<m;k++) > { sum[k]=0; > scanf("%s",&str[k]); > for (i=0;i<n;i++) > for (j=i;j<n;j++) > if (str[k][i]>str[k][j]) sum[k]++; > } > > for (i=0;i<m;i++) for (j=i+1;j<m;j++) 如果i=m-1???????? for (i=0;i<m-1;i++) { for (j=i+1;j<m;j++) if (sum[i]>sum[j]) { strcpy(temp,str[i]); strcpy(str[i],str[j]); strcpy(str[j],temp); t=sum[i]; sum[i]=sum[j]; sum[j]=t; } printf("%s\n",str[i]); } printf("%s\n",str[i+1]); Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator