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 |
我是个新手,那位高手能指点一下,怎么就Runtime Error拉,谢谢拉#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator