Complementing a Strand of DNA
来源:互联网 发布:js定义数组添加元素 编辑:程序博客网 时间:2024/05/14 20:20
Problem
In DNA strings, symbols 'A' and 'T' are complements of each other, as are 'C' and 'G'.
The reverse complement of a DNA string s is the string sc formed by reversing the symbols of s, then taking the complement of each symbol (e.g., the reverse complement of "GTCA" is "TGAC").
Given: A DNA string s of length at most 1000 bp.
Return: The reverse complement sc of s.
Sample Dataset
AAAACCCGGT
Sample Output
In DNA strings, symbols 'A' and 'T' are complements of each other, as are 'C' and 'G'.
The reverse complement of a DNA string s is the string sc formed by reversing the symbols of s, then taking the complement of each symbol (e.g., the reverse complement of "GTCA" is "TGAC").
Given: A DNA string s of length at most 1000 bp.
Return: The reverse complement sc of s.
Sample Dataset
AAAACCCGGT
Sample Output
ACCGGGTTTT
#include <stdio.h>void main (){char s[9999];int i=0;int cnt =0;int cnt_a=0;int cnt_c=0;int cnt_g=0;int cnt_t=0;puts("输入:\n");gets(s);for(i=0;s[i]!='\0';i++){if (s[i] == 'C'){s[i] = 'G';continue;}if (s[i] == 'G'){s[i] = 'C';continue;}if (s[i] == 'T'){s[i] = 'A';continue;}if (s[i] == 'A'){s[i] = 'T';continue;}}cnt = i;for(;cnt>0;cnt--){printf("%c",s[cnt-1]);}}
- Complementing a Strand of DNA
- Complementing a Strand of DNA
- The Secret of Strand Hill (Episode 113)
- DNA is a semiconductor
- A计划--POJ1007 DNA Sorting
- Strand Sort
- asio strand
- Solution of ZOJ 1188 DNA Sorting
- Codeforces 521A - DNA Alignment (思维)
- Codeforces 521A DNA Alignment 规律
- Codeforces 521A DNA Alignment【贪心+思维】
- DNA
- DNA
- DNA
- How to tell RNA-seq library type of strand-specific for RNA-seq data (for reads mapping by Tophat)
- STRAND的构成
- boost::asio::Io_service strand
- Oracle Redo Strand
- ubuntu(linux mint 13)如何安装显卡驱动
- arcmap问题集合
- 这个世界是通往另一个世界的化妆间
- getaddrinfo()函数详解
- 人人 突破 权限 相册 查看
- Complementing a Strand of DNA
- redhat enterprise 5 install chinese input method (scim)
- dede 搬家 数据空白
- The Prisoner of Zenda——1、The Rasendylls-and the Elphbergs
- Visual Studio 2010——解决方案资源管理器
- 黑马程序员_HashMap集合的两种取出方式
- Ubuntu搭建Git服务器
- 【VOIP】优质博客
- windows 远程部署