Advertisement
TeMePyT

Untitled

Jun 3rd, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.29 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 _06.DNA_Sequences
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             string[] nucleotides = new string[] { "", "A", "C", "G", "T" };
  14.  
  15.             int value = int.Parse(Console.ReadLine());
  16.  
  17.             int counter = 0;
  18.             for (int i = 1; i <5; i++)
  19.             {
  20.                 for (int j = 1; j <5; j++)
  21.                 {
  22.                     for (int k = 1; k < 5; k++)
  23.                     {
  24.                         if(i+j+k>=value)
  25.                         {
  26.                             Console.Write($"O{nucleotides[i]}{nucleotides[j]}{nucleotides[k]}O ");
  27.                             counter++;
  28.                         }
  29.                         else
  30.                         {
  31.                             Console.Write($"X{nucleotides[i]}{nucleotides[j]}{nucleotides[k]}X ");
  32.                             counter++;
  33.                         }
  34.                         if (counter == 4)
  35.                         {
  36.                             Console.WriteLine();
  37.                             counter = 0;
  38.                         }
  39.                     }
  40.                 }
  41.             }
  42.         }
  43.     }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement