Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

哪位大哥帮忙看看,我用题目的数据可以通过但提交就不行了!

Posted by shan582 at 2004-10-03 22:11:17 on Problem 1007
#include<stdio.h>
#include<math.h>
main()
{ int m,n,i,b[100],p,c[100],temp,j,q,count;
char a[50][100];
scanf("%d%d",&m,&n);
for(i=0;i<n;i++)
for(j=0;j<m+1;j++)
 scanf("%c",&a[i][j]);
for(i=0;i<n;i++)
{
count=0;
for(j=0;j<m+1;j++)
for(p=j+1;p<m+1;p++)
{if (a[i][j]>a[i][p])
count++;
}
b[i]=count;
}
for(i=0;i<n;i++)
 c[i]=b[i];
for(i=0;i<n;i++)
for(j=i+1;j<n;j++)
if  (c[i]>c[j])
{         temp=c[i];
		c[i]=c[j];
		c[j]=temp;
}
for(i=0;i<n;i++)
for(j=0;j<n;j++)
 if (c[i]==b[j])
 {       for(q=0;q<m+1;q++)
		   printf("%c",a[j][q]);

}
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator