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

为什么我在积极的机器上答案正确,可是却wrong answer??

Posted by maomaolxm at 2004-07-15 13:52:22 on Problem 1007
#include <stdio.h>
#define NAX 100
#define MAX 1000
void main()
{
	int p,n,i,j,k,m,b[MAX];
	char a[NAX][NAX];
	printf("请给出DNA串的碱基数和串数,以空格隔开\n");
	scanf("%d %d\n",&n,&p);
	for(i=0;i<p;i++)
	{
		for(j=0;j<=n;j++)
		{
			scanf("%c",&a[i][j]);
		}
	}
	for(i=0;i<p;i++)
	{
		b[i]=0;
		for(j=0;j<n;j++)
		{
			for(k=j+1;k<n;k++)
			{
				if(a[i][j]>a[i][k])  b[i]++;
			}
		}
	}
	for(i=0;i<p;i++)
	{
		m=i;
		for(j=0;j<p;j++)
		{
			if(b[m]>b[j])
			{
				m=j;
			}
		}
		b[m]=MAX;
		for(k=0;k<n;k++)
		{
			printf("%c",a[m][k]);
		}
		printf("\n");
	}
	
}

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