-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdnastorage.cpp
More file actions
43 lines (42 loc) · 880 Bytes
/
dnastorage.cpp
File metadata and controls
43 lines (42 loc) · 880 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <bits/stdc++.h>
using namespace std;
int main()
{
// your code goes here
int z;
cin >> z;
while (z--)
{
int num, j, i;
cin >> num;
char v;
char etc[1000];
for (int j = 0; j < num; j++)
{
cin >> etc[j];
}
for (int j = 0; j < num - 1; j += 2)
{
int i = j + 1;
if (etc[j] == '0' && etc[i] == '0')
{
v = 'A';
}
else if (etc[j] == '0' && etc[i] == '1')
{
v = 'T';
}
else if (etc[j] == '1' && etc[i] == '0')
{
v = 'C';
}
else if (etc[j] == '1' && etc[i] == '1')
{
v = 'G';
}
cout << v;
}
cout << "\n";
}
return 0;
}