Advertisement
MonsterScripter

CodinGame_2023_08_22__22_07_45__repeats_chars.c

Aug 22nd, 2023 (edited)
946
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.46 KB | None | 0 0
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3. #include <string.h>
  4. #include <stdbool.h>
  5.  
  6. int main()
  7. {
  8.     char DNA[21];
  9.     scanf("%[^\n]", DNA);
  10.     for (int i=0; i < strlen(DNA); i++) {
  11.         if (DNA[i] == 'A') {
  12.             for (int j=0; j<2; j++) printf("A");
  13.         } else if (DNA[i] == 'T') {
  14.             for (int j=0; j<3; j++) printf("T");
  15.         } else if (DNA[i] == 'C') {
  16.            printf("C");
  17.         }
  18.     }
  19.     printf("\n");
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement