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

为什么是presentaton error呢?

Posted by wanglei5012 at 2010-05-01 10:45:04 on Problem 1007
#include <iostream>
using namespace std;
int main()
{
	char**DNA,*temp1;
	int*a,n,m,i,j,k,temp2;
	cin>>n>>m;
	DNA=new char*[m];
	a=new int[m];
	for(i=0;i<m;i++)
	{DNA[i]=new char[n+1];a[i]=0;}
	for(i=0;i<m;i++)
	    cin>>DNA[i];
	for(i=0;i<m;i++)
		for(j=0;j<n-1;j++)
				switch(DNA[i][j])
		{
				case 'A':break;
				case 'C':{for(k=j+1;k<n;k++)if(DNA[i][k]=='A')a[i]++;break;}
				case 'G':{for(k=j+1;k<n;k++)if(DNA[i][k]=='A'||DNA[i][k]=='C')a[i]++;break;}
				case 'T':{for(k=j+1;k<n;k++)if(DNA[i][k]!='T')a[i]++;break;}
		}
	cout<<endl;
	for(i=0;i<m-1;i++)
		for(j=i+1;j<m;j++)
			if(a[i]>a[j])
			{
				temp1=DNA[i];
				DNA[i]=DNA[j];
				DNA[j]=temp1;
				temp2=a[i];
				a[i]=a[j];
				a[j]=temp2;
			}
	for(i=0;i<m;i++)cout<<DNA[i]<<endl;
	cout<<endl;
	return 0;
}

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