Advertisement
ibakyrdjiev

Untitled

Jul 22nd, 2014
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.85 KB | None | 0 0
  1. using System;
  2. using System.Runtime.InteropServices;
  3.  
  4. class DNA
  5. {
  6.     static void Main()
  7.     {
  8.         int dnaSize = 7;
  9.         int lenht = int.Parse(Console.ReadLine());
  10.         char startChar = char.Parse(Console.ReadLine());
  11.         char[] DNA = {'A','B','C','D','E','F','G'};
  12.         int i = 0;
  13.         switch (startChar)
  14.         {
  15.             case 'A':
  16.                 i = 0; break;
  17.             case 'B':
  18.                 i = 1; break;
  19.             case 'C':
  20.                 i = 2; break;
  21.             case 'D':
  22.                 i = 3; break;
  23.             case 'E':
  24.                 i = 4; break;
  25.             case 'F':
  26.                 i = 5; break;
  27.             case 'G':
  28.                 i = 6; break;
  29.         }
  30.         string middle = Convert.ToString(DNA[i]);
  31.  
  32.         int outerDots = 3;
  33.        int b = 0;
  34.         int c = 0;
  35.         int counter = 0;
  36.         while (true)
  37.         {
  38.             if (counter <= 3)
  39.             {
  40.  
  41.                 if (b % 3 == 0)
  42.                 {
  43.                     if (b == 12)
  44.                     {
  45.                         middle = "";
  46.                         outerDots = 1;
  47.                         break;
  48.                     }
  49.  
  50.                     Console.WriteLine(new string('.', outerDots) + middle + new string('.', outerDots));
  51.                     startChar++;
  52.                     outerDots--;
  53.                 }
  54.                 else
  55.                 {
  56.                     if (i == 7)
  57.                     {
  58.                         i = 0;
  59.                     }
  60.                     middle += "" + DNA[i];
  61.  
  62.                 }
  63.  
  64.                 b++;
  65.  
  66.  
  67.  
  68.                 if (b ==12)
  69.                 {
  70.                     break;
  71.                 }
  72.                 i++;
  73.             }
  74.             else
  75.             {
  76.                
  77.             }
  78.          
  79.            
  80.  
  81.         }
  82.     }
  83. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement