-
Notifications
You must be signed in to change notification settings - Fork 0
/
dna.cpp
executable file
·19 lines (15 loc) · 1.32 KB
/
dna.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <cstdio>
#include <string>
using namespace std;
int main(){
string s ="TTGCCACATCCACTGTGTACCAAATTTGGCTGTCTAAAAAGATTAGTCTGTAAATGTAAGAGGGCCATGTTAGGATCGAGTGCACGCTAAAAAGTGCTCCCTGATTTCACTATAGAAGTGGTCTAGGTTCATAGGCGTATTCGGTCTAGTGGTGCTGGATCTCTCTCCATGCTGTTCCGGTACAAAAGCAGTGCCTTGGGCTCTTTAACTAACCTCCACTTATTCCTCTCGGAAGTGCCCGAGCTATTCGGCACGAACGGCCAGAACAATTGACTTGTCACAGGAGCTTACAATCCCGCGTCCCAGGATCAGATTGTAGTGTACCGGAGATATAAGCTAAGATTGACCAAACTAGGTCGTCACTCGGGACAACGTCGTTACGTCGTGAGGCCCCAAGTGCGAACGGTAAGGATTACATTTGGTCGTATATATAGTACTACGCAGCTCCGCAGAATCTCTGAGTCACTCATCCTAAAAGGACCTATGAAGCGCGTATAACGGGGCGTCAGTACGGAATGAAGCAACCAACTGGGTATGGCTAGATTTTACAGGGAAGTTTTCGCGTCAAGACCGAAGGAACTGGGGTTGAAAACACTCGGGAGGGGCGATTTTGACCCTGACGGTCTGGTGGTGGTACACCTTGGCGGATCTTGTCGGCCTGCTTGGCTGAACACCCAGAGTCCCGTGGTTTAGATATATGAACGGCTAGCTAGGTGCAACGTCATATAGCCTCGACATCCCTGTTCCTACGTGCAGTATTCTTGGAGCGCATCGAAATAAACAAGTATGGTCCGCACGTGTCCGGCCCTCGTGCGAAAGGACTCTGTCAGATCAGAACGCAATAGCATGATCAATCGTTAGCGCGATGGTATAGTAAGGAGTCGAGACACGGTTATTAACTTGGAGTGGTGTATCGTGTCGCGGATTTTCAGATAGAGACGGCTGTCTTGTAGGAAAAGCGAAAGATAGAAGGACTTCAGGACTC";
int count[4] = {0};
for(int i = 0; i < s.size(); i++) {
if(s[i] == 'A') count[0]++;
else if(s[i] == 'T') count[1]++;
else if(s[i] == 'G') count[2]++;
else if(s[i] == 'C') count[3]++;
}
printf("%d %d %d %d\n", count[0], count[3], count[2], count[1]);
return 0;
}