Advertisement
shawonrog

PROBLEM 3 bio

Dec 10th, 2018
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.38 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. int main()
  4. {
  5.     char s[1000];
  6.     int i,A,G,T,C;
  7.     A = G = T = C = 0 ;
  8.     gets(s);
  9.     int len = strlen(s);
  10.     for ( i=0;i<len;i++)
  11.     {
  12.         if(s[i] == 'A')  A++ ;
  13.         if(s[i] == 'C')  C++ ;
  14.         if(s[i] == 'G')  G++ ;
  15.         if(s[i] == 'T')  T++ ;
  16.  
  17.     }
  18.  
  19.     printf("%d %d %d %d\n", A, C, G, T);
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement