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 |
为什么我在积极的机器上答案正确,可是却wrong answer??#include <stdio.h> #define NAX 100 #define MAX 1000 void main() { int p,n,i,j,k,m,b[MAX]; char a[NAX][NAX]; printf("请给出DNA串的碱基数和串数,以空格隔开\n"); scanf("%d %d\n",&n,&p); for(i=0;i<p;i++) { for(j=0;j<=n;j++) { scanf("%c",&a[i][j]); } } for(i=0;i<p;i++) { b[i]=0; for(j=0;j<n;j++) { for(k=j+1;k<n;k++) { if(a[i][j]>a[i][k]) b[i]++; } } } for(i=0;i<p;i++) { m=i; for(j=0;j<p;j++) { if(b[m]>b[j]) { m=j; } } b[m]=MAX; for(k=0;k<n;k++) { printf("%c",a[m][k]); } printf("\n"); } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator