07: Paired base chain, 07 paired Base

Source: Internet
Author: User

07: Paired base chain, 07 paired Base
07: Paired base chain

  • View
  • Submit
  • Statistics
  • Question
Total time limit:
1000 ms
 
Memory limit:
65536kB
Description

DNA is formed by the combination of two complementary base chains in the double helix. There are four kinds of bases that make up the DNA, namely, the gland, The caturan (A), the bird's urine (G), the y-axis (T), and the center ). We know that, in the corresponding positions of the two complementary bases, the gland is always paired with the cyanine, And the Guanine is always paired with the compatriine. Your task is to give the base sequence on the complementary Chain Based on the base sequence on a single chain.

Input
A string that represents a base chain. The string contains only uppercase letters A, T, G, and C, respectively, which indicate the gland, Y, Y, D, and D. The length of a string cannot exceed 255.
Output
A string containing only uppercase letters A, T, G, and C. It is A base chain that complements the input base chain.
Sample Input
ATATGGATGGTGTTTGGCTCTG
Sample output
TATACCTACCACAAACCGAGAC
 1 #include<iostream> 2 #include<cstdio> 3 #include<cstring> 4 using namespace std; 5 char a[100001]; 6 char ans[100001]; 7 int now=0; 8 int main() 9 {10     gets(a);11     int l=strlen(a);12     for(int i=0;i<l;++i)13     {14         if(a[i]=='A')15         ans[i]='T';16         if(a[i]=='T')17         ans[i]='A';18         if(a[i]=='G')19         ans[i]='C';20         if(a[i]=='C')21         ans[i]='G';22     }23     puts(ans);24     return 0;25 }

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.