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 |
为什么是presentaton error呢?#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator