Advertisement
YavorGrancharov

DNA_Sequences

Jun 6th, 2017
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.05 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace DNA_Sequences
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int n = int.Parse(Console.ReadLine());
  14.  
  15.             string[] acid = { "A", "C", "G", "T" };
  16.  
  17.             int i, j, k;
  18.  
  19.             for (i = 1; i <= 4; i++)
  20.             {
  21.                 for (j = 1; j <= 4; j++)
  22.                 {
  23.                     for (k = 1; k <= 4; k++)
  24.                     {
  25.                         int sum = i + j + k;
  26.  
  27.                         if (sum >= n)
  28.                         {
  29.                             Console.Write($"O{acid[i - 1]}{acid[j - 1]}{acid[k - 1]}O ");
  30.                         }
  31.                         else
  32.                         {
  33.                             Console.Write($"X{acid[i - 1]}{acid[j - 1]}{acid[k - 1]}X ");
  34.                         }
  35.                     }
  36.                     Console.WriteLine();
  37.                 }
  38.             }
  39.         }
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement