| ||||||||||
| 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 | |||||||||
哪位大哥帮忙看看,我用题目的数据可以通过但提交就不行了!#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator