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

Re:帮忙看看啊,VC运行成功了,但就是WA啊!

Posted by zjazczjazc at 2009-07-23 10:26:22 on Problem 1007
In Reply To:帮忙看看啊,VC运行成功了,但就是WA啊! Posted by:qichao at 2009-07-21 13:00:03
> #include<stdio.h>
> #include<string.h>
> 
> int main()
> {
> 	char dna[100][51],tem[51];
> 	int i,j,k,m,n,a[51]={0},tem1;
> 	scanf("%d %d",&n,&m);
> 	getchar();
> 	for(k=0;k<m;k++)
> 	{
> 		gets(dna[k]);
> 		for(i=0;i<n-1;i++)
> 		{
> 			for(j=i+1;j<n;j++)
> 			{
> 				if(dna[k][i]>dna[k][j])
> 					a[k]++;
> 			}
> 		}	
> 	}
> 	for(i=0;i<m-1;i++)
> 	{		
> 		for(j=i+1;j<m;j++)
> 		{
> 			if(a[i]>a[j])
> 			{
> 				tem1=a[i];
> 				a[i]=a[j];
> 				a[j]=tem1;
> 				strcpy(tem,dna[i]);
> 				strcpy(dna[i],dna[j]);
> 				strcpy(dna[j],tem);
> 			}
> 		}
> 	}
> 	for(i=0;i<m;i++)
> 		puts(dna[i]);
> }

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