UVa 1368 DNA Consensus String
来源:互联网 发布:追星的软件 编辑:程序博客网 时间:2024/06/14 08:21
#include <stdio.h>char s[51][1001];char compareA(int countA, int countC, int countG, int countT){int temp = countT;char c = 'T';if(temp <= countG) {temp = countG;c = 'G';}if(temp <= countC){temp = countC;c = 'C';}if(temp <= countA){temp = countA;c = 'A';}return c;}int main(){int num = 0;int m, n;scanf("%d", &num);while(num--){scanf("%d %d", &m, &n);for(int i=0; i<m; i++) { scanf("%s",s[i]); } int countA=0, countC=0, countG=0, countT=0; char temp; int total = 0; int all = 0; for(int i = 0; i < n; i++) { countA=0, countC=0, countG=0, countT=0;for(int j = 0; j < m; j++) { if(s[j][i] == 'A') countA++; else if(s[j][i] == 'C') countC++; else if(s[j][i] == 'G') countG++; else if(s[j][i] == 'T') countT++;}temp = compareA(countA, countC, countG, countT);total = countA + countC + countG + countT;if(temp == 'A') total -= countA; else if(temp == 'C') total -= countC; else if(temp == 'G') total -= countG; else if(temp == 'T') total -= countT; all += total;printf("%c", temp);}printf("\n");printf("%d\n", all);}return 0;}
0 0
- UVA 1368 - DNA Consensus String
- uva 1368 DNA Consensus String
- Uva-1368-DNA Consensus String
- UVa 1368 DNA Consensus String
- UVA 1368 DNA Consensus String
- UVA 1368 DNA Consensus String
- UVa:1368 DNA Consensus String
- uva 1368 - DNA Consensus String
- UVa 1368 - DNA Consensus String
- UVa 1368 - DNA Consensus String
- UVa 1368 DNA Consensus String
- UVa 1368 - DNA Consensus String
- UVA - 1368 DNA Consensus String
- UVa 1368DNA Consensus String
- UVa 1368 - DNA Consensus String
- Uva 1368 DNA Consensus String
- 【Uva 1368】 DNA Consensus String
- UVa-1368 - DNA Consensus String
- 得到view的信息以及 view绘制流程解析(二)
- SqlServer表格卡死问题--事务问题
- 对象复制
- Android apk文件资源混淆原理及实现
- java保留两位小数【转】
- UVa 1368 DNA Consensus String
- 计蒜客 第3题:判断质数
- lower_bound函数和upper_bound函数实例
- 从管理国家领悟大厅类游戏架构。
- KenBurnsView:实现Ken Burns effect图片展示效果的效果android控件
- CentOs Yum方式安装Mongodb
- Spring3.0 AOP 详解
- oracle中with table as临时表
- 说谎的代价