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 |
Re:呼……为了弄那个得分表格弄了N长的代码……不过省了空间……160K 0msIn Reply To:呼……为了弄那个得分表格弄了N长的代码……不过省了空间……160K 0ms Posted by:luyao1103 at 2010-09-27 18:46:43 我也用了SWITCH 但我用的是二维数组,看起来简单些 #define A 1 #define C 2 #define G 3 #define T 4 #define B 5//B表示空格 value[A][A]=5;value[A][C]=value[C][A]=-1;value[A][G]=value[G][A]=-2; value[A][T]=value[T][A]=-1;value[A][B]=value[B][A]=-3; value[C][C]=5;value[C][G]=value[G][C]=-3;value[C][T]=value[T][C]=-2; value[C][B]=value[B][C]=-4; value[G][G]=5;value[G][T]=value[T][G]=-2;value[G][B]=value[B][G]=-2; value[T][T]=5;value[T][B]=value[B][T]=-1; 然后我用数字表示字母 switch(oria[i]){ case 'A':a[i]=A;break; case 'G':a[i]=G;break; case 'C':a[i]=C;break; case 'T':a[i]=T;break; 但我实现写的不太好,开了几个多余的数组,貌似内存有点浪费 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator