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 }