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

我是个新手,那位高手能指点一下,怎么就Runtime Error拉,谢谢拉

Posted by clean at 2005-04-30 17:59:17 on Problem 1007
#include<iostream>
using namespace std;
typedef int* DNA_count;
typedef char* DNA;
int main()
{
	int d1,d2,min;
	cin>>d1>>d2;
	DNA_count count;
	DNA *m=new DNA[d1];
	count=new int[d2];
	int i,j,k;
	for(i=0;i<d2;i++)
	{
		m[i]=new char[d1];
		count[i]=0;
	}
	for(i=0;i<d2;i++)
		for(j=0;j<d1;j++)
		{cin>>m[i][j];}
	for(i=0;i<d2;i++)
	 for(j=0;j<d1;j++)
	  for(k=j+1;k<d1;k++)
	  {
		  if(m[i][j]>m[i][k])
			  count[i]++;
	  }
	  for(i=0;i<d2;i++)
	  {
		  min=d1*d2;
		  for(j=0;j<d2;j++)
		  {
			  if(count[j]<min)
		      min=count[j];
		  }
		  for(k=0;k<d2;k++)
		  {
			  if(count[k]==min)
			  {count[k]=100;min=k;}
		  }
		  for(j=0;j<d1;j++)
		  {
			  cout<<m[min][j];
		  }
		  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