| ||||||||||
| 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 | |||||||||
大虾们,我要崩溃了,VC运行可以,为啥就是无法AC呢?#include<iostream>
using namespace std;
int main()
{
char f[60][90];
long p[60]={0},q;
int a,b;
cin>>a>>b;
for(int i=0;i<b;i++)
{
for(int j=0;j<a;j++)
{
cin>>f[i][j];
}
f[i][a]=NULL;
for(int k=0;k<a-1;k++)
for(int l=k+1;l<a;l++)
{
if((f[i][k]=='C')&&(f[i][l]=='A'))
{
p[i]++;
}else
if((f[i][k]=='G')&&((f[i][l]=='C')||(f[i][l]=='A')))
{
p[i]++;
}else
if((f[i][k]=='T')&&((f[i][l]=='C')||(f[i][l]=='A')||(f[i][l]=='G')))
{
p[i]++;
}
}
}
for(int x=0;x<b;x++)
{
q=x;
for(int y=0;y<b;y++)
{
if(((p[q]>p[y])||(p[q]==-1))&&(p[y]!=-1))
{
q=y;
}
}
cout<<f[q]<<endl;
p[q]=-1;
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator