Advertisement
n4wn4w

3zadacha

Mar 20th, 2015
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 26.55 KB | None | 0 0
  1. NAKOV //////////////////////////////////////////////////////////////////////////////
  2.    int n = int.Parse(Console.ReadLine());
  3.             for (int i = n; i >= 1; i -=2)
  4.             {
  5.                 string asteriks = new string('*',i);
  6.                string dashes = new string('-',(n-i) /2);
  7.                 Console.WriteLine("{0}{1}{0}", dashes, asteriks);  
  8.             }
  9.             for (int i = 3; i <= n; i += 2)
  10.             {
  11.                 string asteriks = new string('*', i);
  12.                 string dashes = new string('-', (n - i) / 2);
  13.                 Console.WriteLine("{0}{1}{0}", dashes, asteriks);
  14.             }
  15.  
  16.  
  17.  
  18.  
  19.  
  20. 1  Sun GLASSES ////////////////////////////////////////////////////////////////////////////////
  21.            
  22.             int n = int.Parse(Console.ReadLine());
  23.  
  24.             //top
  25.             Console.WriteLine("{0}{1}{0}", new string('*', n * 2), new string(' ', n));
  26.            
  27.             //middle
  28.           for (int i = 0; i < n-2; i++)
  29.            {
  30.                Console.Write('*');
  31.                Console.Write(new string('/', n*2 -2 ));
  32.                Console.Write('*');
  33.                Console.WriteLine("{0}{1}{2}{1}{0}", new string('*', 1), new string ('/',n*2-2),new string(' ',n));
  34.                if (i == n/2-1)
  35.                {
  36.                    Console.Write(new string('|',n));
  37.               }
  38.                else
  39.                {
  40.                    Console.Write(new string(' ',n));
  41.                }
  42.               Console.Write('*');
  43.               Console.Write(new string('/', n * 2 - 2));
  44.               Console.Write('*');
  45.               Console.WriteLine();
  46.         }
  47.                 //bottom
  48.                 Console.WriteLine("{0}{1}{0}", new string('*', n * 2), new string(' ', n));
  49.                
  50.                
  51.                
  52.  
  53.  
  54.  
  55. 3 EXPLORER _ DIAMOND /////////////////////////////////////////////////////////
  56.                
  57.         int n = int.Parse(Console.ReadLine());
  58.  
  59.             int outd = n / 2;
  60.             int innd = 1;
  61.             //top
  62.             Console.WriteLine("{0}*{0}", new string('-', n / 2));
  63.  
  64.             //mid
  65.  
  66.  
  67.             for (int i = 0; i < n / 2; i++)
  68.             {
  69.                 outd--;
  70.                 string kondio = new string('-', outd);
  71.                 string doko = new string('-', innd);
  72.  
  73.                 Console.WriteLine("{0}*{1}*{0}", kondio, doko);
  74.                 innd += 2;
  75.  
  76.             }
  77.             //second haff mid
  78.             innd = n - 4;
  79.             outd = 0;
  80.            
  81.             for (int i = 0; i < n / 2-1; i++)
  82.             {
  83.                 outd++;
  84.                 string kondio = new string('-', outd);
  85.                 string doko = new string('-', innd);
  86.              
  87.                 Console.WriteLine("{0}*{1}*{0}", kondio, doko);
  88.                 innd -= 2;
  89.                
  90.             }
  91.             Console.WriteLine("{0}*{0}", new string('-', n / 2));
  92.  
  93.  
  94.  
  95.  
  96.  
  97. 4 NEW HOUSE //////////////////////////////////////////////////////////////
  98.        
  99.         int n = int.Parse(Console.ReadLine());
  100.             int inner = 1;
  101.             outdots = n / 2;
  102.             //int outdots = n /2;
  103.             for (int i = 0 ; i <= n/2; i++)
  104.             {
  105.                 outdots--;
  106.                 Console.WriteLine("{0}{1}{0}", new string('.', outdots), new string('#', inner));
  107.                 inner += 2;
  108.                
  109.             }
  110.             for (int j = 0; j < n; j++)
  111.             {
  112.                 Console.WriteLine("{0}{1}{0}","_",new string('*',n-2));
  113.             }
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122. 5  HOUSE INNER ANS OUTER DOTS //////////////////////////////////////////////////////////
  123.            
  124.            
  125.             int n = int.Parse(Console.ReadLine());
  126.  
  127.             int innd = 1;
  128.             int outd = n / 2;
  129.  
  130.             Console.WriteLine("{0}*{0}", new string('.', n / 2));
  131.  
  132.             for (int i = 0; i < n/2 -1; i++)
  133.             {
  134.                 outd--;
  135.                 string inner = new string('.', innd);
  136.                 string outer = new string('.', outd);
  137.  
  138.                 Console.WriteLine("{0}*{1}*{0}", outer, inner);
  139.                 innd += 2;
  140.             }
  141.             Console.WriteLine("{0}", new string('*', n));
  142.  
  143.             //dolnata 4ast na kushtata
  144.  
  145.             int wallDistance = n / 4;
  146.  
  147.             for (int i = 0; i < n / 2 - 1; i++)
  148.             {
  149.  
  150.                 Console.WriteLine("{0}{1}{2}{1}{0}", new string('.', wallDistance),new string('*', 1), new string('.', n - 2 * wallDistance - 2));
  151.                
  152.             }
  153.  
  154.             //bottom
  155.             Console.WriteLine("{0}{1}{2}{1}{0}", new string('.', wallDistance),new string('*', 1), new string('*', n - 2 * wallDistance - 2));
  156.            
  157.            
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165. 6 ARROW  ////////////////////////////////////////////////////////////////////////////////////////////////
  166.            
  167.             int n = int.Parse(Console.ReadLine());
  168.  
  169.             int innd = (2*n)-5;
  170.             int outd = 1;
  171.  
  172.             Console.WriteLine("{0}{1}{0}", new string('.', n / 2), new string('#', n));
  173.             //top
  174.             for (int i = 0; i < n - 2; i++)
  175.             {
  176.                
  177.                
  178.  
  179.                 Console.WriteLine("{0}#{1}#{0}", new string('.', n/2),new string('.', n-2));
  180.                
  181.             }
  182.  
  183.  
  184.             Console.WriteLine("{0}{1}{0}", new string('#', n / 2 + 1), new string('.', n -2));
  185.             // bottom
  186.             for (int i = 0; i < n-2; i++)
  187.             {
  188.                
  189.                 string inner = new string('.', innd);
  190.                 string outer = new string('.', outd);
  191.  
  192.                 Console.WriteLine("{0}#{1}#{0}", outer, inner);
  193.                 outd++;
  194.                 innd -= 2;
  195.             }
  196.             Console.WriteLine("{0}#{0}", new string('.', n - 1));
  197.         }
  198.  
  199.  
  200.  
  201.  
  202.  
  203. 7 WINE GLASS chasha za vino //////////////////////////////////////////////////////////////////////////////
  204.        
  205.         int n = int.Parse(Console.ReadLine());
  206.             int borderSpacing = 0;
  207.             int middleSpacing = n - 2;
  208.  
  209.  
  210.             //top na chashata
  211.             for (int i = 0; i < n / 2 - 1; i++)
  212.             {
  213.  
  214.                 string dots = new string('.', borderSpacing);
  215.                 string asterisks = new string('*', middleSpacing);
  216.                 Console.WriteLine("{0}\\{1}/{0}", dots, asterisks);
  217.                 borderSpacing++;
  218.                 middleSpacing -= 2;
  219.             }
  220.             Console.WriteLine("{0}\\/{0}", new string('.', n/2-1));
  221.  
  222.             // mid drujkata
  223.             if (n >= 12)
  224.             {
  225.                 for (int i = 0; i < n/2-2; i++)
  226.                 {
  227.                     Console.WriteLine("{0}||{0}", new string('.', n / 2 - 1));
  228.                 }
  229.             }
  230.             else if (n < 12)
  231.             {
  232.                 for (int i = 0; i < n / 2 - 1; i++)
  233.                 {
  234.                     Console.WriteLine("{0}||{0}", new string('.', n / 2 - 1));
  235.                 }
  236.             }
  237.             // bottom osnovata
  238.  
  239.  
  240.             if (n >= 12)
  241.             {
  242.                 Console.WriteLine("{0}", new string('-', n));
  243.                 Console.WriteLine("{0}", new string('-', n));
  244.             }
  245.             else if (n < 12)
  246.             {
  247.                 Console.WriteLine("{0}", new string('-', n));
  248.             }
  249.            
  250.            
  251.  
  252.  
  253.  
  254. 8 PROGRAMER DNA ////////////////////////////////////////////////////////////////////////////////
  255.            
  256.             int n = int.Parse(Console.ReadLine());
  257.             int rowLenght = 7;
  258.             char startingLetter = (char)Console.Read();
  259.  
  260.             int dots = rowLenght / 2;
  261.             int dotsCount = 1;
  262.  
  263.             for (int i = 0; i < n; i++)
  264.             {
  265.                 Console.Write(new string('.', dots));
  266.                 // pechatame gornata 4ast na to4kite
  267.                 for (int j = 0; j < rowLenght - 2 * dots; j++)// pechati lettera/bukvata tolkova puti kolkoto trqbva da se vurti for cikula v purvoto zavurtane e 1 zashtoto e 7 - dots/3 * 2 pri vtoroto 3 puti zashtoto 7 - 2 * 2 = 3
  268.                 {
  269.                     // pechatame bukvite
  270.                     Console.Write(startingLetter);
  271.                     startingLetter++;
  272.                     if (startingLetter == 'H')
  273.                        {
  274.                         startingLetter = 'A';
  275.                        }
  276.                 }
  277.                 // pechatame dolata 4ast na bukvite
  278.                 Console.WriteLine(new string('.', dots));
  279.                dots = dots - dotsCount; // vadim ot dots - 1 za da namalim to4kite // dotsCount = 1
  280.  
  281.                if (dots == -1)  // ako dots mi stane -1 vliza v if i mi go promenq  na 1
  282.                {
  283.                   dots = 1;
  284.                  
  285.                   dotsCount = dotsCount * -1;
  286.                    // pravi go 1 * -1 za da  naprvi dotsCount na -1 sled tova umnojava -1 * -1 = 1 i subira s 1 + 1 za da stane 2 i uvelichava
  287.                }
  288.              
  289.                else if (dots == rowLenght / 2 + 1)
  290.                // ako dots stanat 4 to vlez v cikula i gi napravi pak da sa 3 i mi gi namalqi s po 1
  291.                {
  292.                    dots = rowLenght / 2;
  293.                    dotsCount = dotsCount * -1;
  294.                }
  295.                
  296.                
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  KONDIO Dna primer ot porgramer dna //////////////////////////////////////////             
  304.                 nt n = int.Parse(Console.ReadLine());
  305.             int rowLenght = 7;
  306.            
  307.             int kondio = 1;
  308.             int doko = 2;
  309.             int dots = rowLenght / 2;
  310.             int dotsCount = 1;
  311.  
  312.             for (int i = 0; i < n; i++)
  313.             {
  314.  
  315.                 // pechatame dolata 4ast na bukvite
  316.                 Console.WriteLine("{0}{1}{0}", new string('.', dots), new string('#', kondio), new string('.', dots));
  317.                 kondio = kondio + doko;
  318.  
  319.                 if (kondio == 9)
  320.                 {
  321.                     kondio = 5;
  322.                     doko = doko * -1;
  323.                 }
  324.  
  325.                 if (kondio == -1)  // ako dots mi stane -1 vliza v if i mi go promenq  na 1
  326.                 {
  327.                     kondio = 1;
  328.  
  329.                     doko = doko * -1;
  330.                     // pravi go 1 * -1 za da  naprvi dotsCount na -1 sled tova umnojava -1 * -1 = 1 i subira s 1 + 1 za da stane 2 i uvelichava
  331.                 }
  332.                 ///////////////////////////////////////////////////////////// po4vat dots
  333.                 dots = dots - dotsCount; // vadim ot dots - 1 za da namalim to4kite // dotsCount = 1
  334.  
  335.                 if (dots == -1)  // ako dots mi stane -1 vliza v if i mi go promenq  na 1
  336.                 {
  337.                     dots = 1;
  338.  
  339.                     dotsCount = dotsCount * -1;
  340.                     // pravi go 1 * -1 za da  naprvi dotsCount na -1 sled tova umnojava -1 * -1 = 1 i subira s 1 + 1 za da stane 2 i uvelichava
  341.                 }
  342.                 else if (dots == rowLenght / 2 + 1)
  343.                 // ako dots stanat 4 to vlez v cikula i gi napravi pak da sa 3 i mi gi namalqi s po 1
  344.                 {
  345.                     dots = rowLenght / 2;
  346.                     dotsCount = dotsCount * -1;
  347.                 }
  348.                
  349.                
  350.  
  351.  
  352.  
  353.  
  354. 28 april DISK /////////////////////////////////////////////////////////////////////////////////////////////////////
  355.                
  356.         int n = int.Parse(Console.ReadLine());
  357.             int r = int.Parse(Console.ReadLine());
  358.             int centerX = n / 2;////////// delim na 2 za da zapo4va da pechati ot centura na poleto ot '*'
  359.             int centerY = n / 2;/////////
  360.             for (int i = 0; i < n; i++)
  361.             {
  362.                 for (int k = 0; k < n; k++)
  363.                 {
  364.                     int distY = Math.Abs(centerY - i);
  365.                     int distX = Math.Abs(centerX - k);
  366.  
  367.                    double distanceToCenter = Math.Sqrt(distX * distX + distY * distY);
  368.  
  369.                    if (distanceToCenter <= r)
  370.                    {
  371.                        Console.Write("*");
  372.                    }
  373.                    else
  374.                    {
  375.                       Console.Write(".");
  376.                    }
  377.                    
  378.                 }
  379.                Console.WriteLine();
  380.             }
  381.  
  382.        
  383.  
  384.  
  385.  
  386.  
  387. 25 july morning SCOTLAD FLAG ///////////////////////////////////////////////////////////////////////////
  388.              /////////////////// prefikstato reshenie 90 to4ki
  389.              char currChar = 'A';
  390.         int n = int.Parse(Console.ReadLine());
  391.        
  392.        // Console.WriteLine(currChar++ + new string('#', n - 2) + currChar++);// nai-gorniqt statichen red na koito obache nqma da se uvelichava char currChar++
  393.         if (currChar == 'Z') // '['
  394.             currChar = 'A';
  395.         Console.Write(currChar);
  396.         Console.Write(new string('#', n - 2));
  397.         Console.Write(++currChar);
  398.         Console.WriteLine();
  399.  
  400.         for (int i = 1; i <= n/2-1; i++)
  401.         {
  402.             Console.Write(new string('~', i));
  403.             if (currChar == 'Z') // '['
  404.                 currChar = '@';
  405.             Console.Write(++currChar);
  406.             Console.Write(new string('#', n - 2 - 2 * i));
  407.             if (currChar == 'Z')
  408.                 currChar = '@';
  409.             Console.Write(++currChar);
  410.             Console.WriteLine(new string('~', i));
  411.         }
  412.  
  413.         Console.Write(new string('-', n/2));
  414.         if (currChar == 'Z') // '['
  415.             currChar = '@';
  416.         Console.Write(++currChar);
  417.         Console.WriteLine(new string('-', n / 2));
  418.  
  419.         for (int i = n/2-1; i >= 1; i--)
  420.         {
  421.             Console.Write(new string('~', i));
  422.             if (currChar == 'Z') // '['
  423.                 currChar = 'A';
  424.             Console.Write(++currChar);
  425.             Console.Write(new string('#', n - 2 - 2 * i));
  426.             if (currChar == 'Z' )
  427.                 currChar = '@';
  428.             Console.Write(++currChar);
  429.             Console.WriteLine(new string('~', i));
  430.         }
  431.         if (currChar == 'Z' + 1) // '['
  432.             currChar = '@';
  433.         Console.Write(++currChar);
  434.         Console.Write(new string('#', n - 2));
  435.         Console.Write(++currChar);
  436.         Console.WriteLine();
  437.          
  438.  
  439.     }
  440. }
  441.      
  442.  
  443.  
  444.  
  445.  
  446. SCOTLAND FLAG 2ro reshenie za 100 to4ki ////////////////////////////////////////////////////////////////////////////////////
  447.      
  448.       char currChar = 'A';
  449.             int n = int.Parse(Console.ReadLine());
  450.  
  451.             for(int i=0; i<=n/2-1;i++)
  452.             {
  453.                 Console.Write(new string('~',i));
  454.                 if (currChar == '[')
  455.                 {
  456.                     currChar = 'A';
  457.                 }
  458.                 Console.Write(currChar++);
  459.                 Console.Write(new string('#', n - 2 - 2 * i));
  460.                 if (currChar == '[')
  461.                 {
  462.                     currChar = 'A';
  463.                 }
  464.                 Console.Write(currChar++);
  465.                 Console.WriteLine(new string('~', i));
  466.             }
  467.  
  468.             Console.Write(new string('-',n/2));
  469.             if (currChar == '[')
  470.             {
  471.                 currChar = 'A';
  472.             }
  473.             Console.Write(currChar++);
  474.             Console.WriteLine(new string('-', n / 2));
  475.  
  476.             for (int i = n/2-1; i >= 0; i--)
  477.             {
  478.                 Console.Write(new string('~', i));
  479.                 if (currChar == '[')
  480.                 {
  481.                     currChar = 'A';
  482.                 }
  483.                 Console.Write(currChar++);
  484.                 Console.Write(new string('#', n - 2 - 2 * i));
  485.                 if (currChar == '[')
  486.                 {
  487.                     currChar = 'A';
  488.                 }
  489.                 Console.Write(currChar++);
  490.                 Console.WriteLine(new string('~', i));
  491.             }
  492.            
  493.  
  494.  
  495. 25 july evening  house with window ////////////////////////////////////////////////////////////////////////////////////
  496.            
  497.            
  498.             int n = int.Parse(Console.ReadLine());
  499.            
  500.            
  501.              int outdots =  n - 1;
  502.              int middots = 1;
  503.  
  504.  
  505.  
  506.             Console.Write("{0}*{0}", new string ('.',outdots));
  507.             Console.WriteLine();
  508.  
  509.             for (int i = 0  ; i < n-1 ; i++)
  510.             {
  511.                outdots--;
  512.                string newoutdots = new string('.', outdots);
  513.                string newmiddots = new string('.', middots);
  514.                Console.WriteLine("{0}*{1}*{0}", newoutdots , newmiddots);
  515.  
  516.               // outdots -= 1;
  517.                middots += 2;
  518.            }
  519.  
  520.             Console.WriteLine(new string('*', n * 2 -1));
  521.  
  522.             for (int j = 0; j <= n / 4 -1; j++)
  523.            {
  524.                 string oouterrdott = new string('.', (2 * n - 1)-2);
  525.  
  526.                Console.WriteLine("*{0}*", oouterrdott);
  527.                
  528.            }
  529.  
  530.  
  531.             for (int h = 0; h <= n / 2 -1 ; h++)
  532.             {
  533.                 string outwindow = new string('.', n / 2);
  534.                 string window = new string('*', n - 3);
  535.                 Console.WriteLine("*{0}{1}{0}*", outwindow, window);
  536.  
  537.             }
  538.             for (int k = 0; k <= n / 4 - 1; k++)
  539.             {
  540.                 string oouterrdott = new string('.', (2 * n - 1) - 2);
  541.  
  542.                 Console.WriteLine("*{0}*", oouterrdott);
  543.  
  544.             }
  545.             Console.WriteLine(new string('*', n * 2 - 1));
  546.  
  547.            
  548.    
  549.  
  550.  
  551.  
  552. 22 avgust CAR ////////////////////////////////////////////////////////////////////////////////
  553.          int n = int.Parse(Console.ReadLine());
  554.  
  555.             int inner = n;
  556.             int outer = n;
  557.  
  558.             Console.WriteLine("{0}{1}{0}", new string('.', n), new string('*', n));
  559.             //top
  560.             for (int i = 0; i < n / 2 -1; i++)
  561.             {
  562.                 outer--;
  563.                 Console.WriteLine("{0}*{1}*{0}", new string('.', outer), new string('.', inner));
  564.                 inner += 2;
  565.             }
  566.  
  567.             Console.WriteLine("{0}{1}{0}", new string('*', n / 2 + 1), new string('.', n * 2 -2));
  568.             //mid
  569.             for (int i = 0; i < n / 2 - 2; i++)
  570.             {
  571.                 Console.WriteLine("*{0}*", new string('.', n * 3 -2));
  572.             }
  573.  
  574.             Console.WriteLine("{0}", new string('*', n * 3));
  575.  
  576.             //bot
  577.             for (int i = 0; i < n / 2 - 2; i++)
  578.             {
  579.  
  580.                 Console.WriteLine("{0}*{1}*{2}*{1}*{0}", new string('.', n /2),new string('.', n /2 -1),new string('.', n -2));
  581.             }
  582.  
  583.             Console.WriteLine("{0}*{1}*{2}*{1}*{0}", new string('.', n / 2), new string('*', n / 2 -1), new string('.', n - 2));
  584.                    
  585.            
  586.            
  587. 26 avgust STAR ///////////////////////////////////////////////////////////////////////////////////
  588.            
  589.              int n = int.Parse(Console.ReadLine());
  590.  
  591.             int outdots = n;
  592.             int inndots = 1;
  593.             int stars= n / 2 + 1;
  594.  
  595.             // top
  596.             Console.WriteLine("{0}*{0}", new string('.', n));
  597.  
  598.             for (int i = 0; i < n / 2 -1 ; i++)
  599.             {
  600.                 outdots--;
  601.                 string outd = new string('.', outdots);
  602.                 string innd = new string('.', inndots);
  603.                 Console.WriteLine("{0}*{1}*{0}", outd , innd);
  604.                 inndots += 2;
  605.             }
  606.            
  607.             //mid
  608.             Console.WriteLine("{0}{1}{0}", new string ('*', n / 2 + 1), new string ('.', n-1));
  609.  
  610.              outdots = 1; // ak beshe 0 to operatora za uvelichavene ++ trqbvashe da e predi Console.WriteLine
  611.              inndots = n * 2 -3;
  612.  
  613.             for (int i = 0; i < n / 2 - 1; i++)
  614.             {
  615.                // outdots++;  ako  outdots mi beshe 0
  616.                 string outd = new string('.', outdots);
  617.                 string innd = new string('.', inndots);
  618.                 Console.WriteLine("{0}*{1}*{0}", outd, innd);
  619.                 outdots++;
  620.                 inndots -= 2;
  621.             }
  622.  
  623.             Console.WriteLine("{0}*{1}*{1}*{0}", new string('.', n / 2), new string('.', n /2 - 1));
  624.  
  625.             //bot
  626.             outdots = n / 2;
  627.             inndots = 1;
  628.  
  629.             for (int i = 0; i < n /2 -1; i++)
  630.             {              
  631.                 outdots--;
  632.                 string outd = new string('.', outdots);
  633.                 string innd = new string('.', inndots);
  634.                
  635.                 Console.WriteLine("{0}*{1}*{2}*{1}*{0}", outd, new string('.', n / 2 -1), innd);
  636.                 inndots += 2;
  637.             }
  638.             Console.WriteLine("{0}{1}{0}", new string('*', n / 2 + 1), new string('.', n - 1));
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646. 7 noemvri PLANE //////////////////////////////////////////////////////////////
  647. int n = int.Parse(Console.ReadLine());
  648.  
  649.             int outdots = n;
  650.             int middots = 1;
  651.            
  652. Console.Write("{0}*{0}", new string('.', (n*2)-(n/2+1)));
  653. Console.WriteLine();
  654.  
  655.             int doko = n;
  656.             int kondio = 1;
  657.             for (int i = 0 ; i < n / 2 + 1; i++)
  658.             {
  659.                 doko--;
  660.                 string newoutdots = new string('.', doko + (doko/2));
  661.                 string newmiddots = new string('.', kondio);
  662.                 Console.WriteLine("{0}*{1}*{0}", newoutdots, newmiddots);
  663.                
  664.                 // outdots -= 1;
  665.                 kondio +=2;
  666.             }
  667.  
  668.             outdots = n;
  669.             middots = n;
  670.  
  671.             for (int i = 0; i < n / 2; i++)
  672.             {
  673.                 outdots -= 2;
  674.                 string newoutdots = new string('.', outdots);
  675.                 string newmiddots = new string('.', middots + 2);
  676.                 Console.WriteLine("{0}*{1}*{0}", newoutdots, newmiddots);
  677.  
  678.                 // outdots -= 1;
  679.                 middots += 4;
  680.             }
  681.  
  682.             Console.WriteLine("*{0}*{1}*{0}*", new string('.', n - 2), new string('.', n));
  683.  
  684.             outdots = n - 4;
  685.             middots = 1;
  686.             for (int i = 0; i < n / 2 - 1; i++)
  687.             {
  688. Console.WriteLine("*{0}*{1}*{2}*{1}*{0}*", new string('.', outdots), new string('.', middots), new string('.', n));
  689.  
  690.                 outdots -= 2;
  691.                 middots += 2;
  692.             }
  693.             outdots = n - 1;
  694.             middots = n;
  695.  
  696.             for (int i = 0; i <= n - 2; i++)
  697.             {
  698. Console.WriteLine("{0}*{1}*{0}", new string('.', outdots), new string('.', middots));
  699.                 outdots -= 1;
  700.                 middots += 2;
  701.             }
  702.             Console.WriteLine(new string('*', n * 3))
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710. 8 noemvri ROKLQ ////////////////////////////////////////////////////////////////////////////////
  711.  
  712.         int n = int.Parse(Console.ReadLine());
  713.  
  714.  
  715.             int outdots = n;
  716.             int middots = n;
  717.             int star = n;
  718.  
  719.             // statichen
  720.             Console.Write("{0}{1}{0}", new string('.', outdots), new string('*', star));
  721.             Console.WriteLine();
  722.             // top
  723.             for (int i = 0; i < n / 2; i++)
  724.             {
  725.                 outdots -= 2;
  726.                 Console.WriteLine("{0}*{1}*{0}", new string('.', outdots), new string('.', middots + 2));
  727.                 middots += 4;
  728.             }
  729.             //statichen
  730.             Console.WriteLine("*{0}*{1}*{0}*", new string('.', n - 2), new string('.', n));
  731.             //mid
  732.             outdots = n - 4;
  733.             middots = 1;
  734.             for (int i = 0; i < n / 2 - 1; i++)
  735.             {
  736.                 Console.WriteLine("*{0}*{1}*{2}*{1}*{0}*", new string('.', outdots), new string('.', middots), new string('.', n));
  737.                 middots += 2;
  738.                 outdots -= 2;
  739.             }
  740.             //bot
  741.             outdots = n - 1;
  742.             middots = n;
  743.  
  744.             for (int i = 0; i <= n - 2; i++)
  745.             {
  746.  
  747.                 Console.WriteLine("{0}*{1}*{0}", new string('.', outdots), new string('.', middots));
  748.                 outdots--;
  749.                 middots += 2;
  750.             }
  751.             //statichen
  752.             Console.WriteLine(new string('*', n * 3));
  753.  
  754.    
  755.            
  756.  
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  19 DEKEMVRI HEADPHONES- slushalki ////////////////////////////////////////////////////////////////////////
  765.              
  766.               int n = int.Parse(Console.ReadLine());
  767.  
  768.            
  769.             int asteriks = 1;
  770.             int dots = n / 2 +1;
  771.            
  772.  
  773.             Console.WriteLine("{0}{1}{0}", new string('-', n / 2), new string('*', n + 2));
  774.  
  775.             for (int i = 0; i < n - 1; i++)
  776.             {
  777.                 Console.WriteLine("{0}*{1}*{0}", new string('-', n / 2), new string('-', n));
  778.             }
  779.            
  780.                 for (int j = 0; j < n / 2 + 1; j++)
  781.                 {
  782.                     dots--;
  783.                     Console.WriteLine("{0}{1}{0}{2}{0}{1}{0}", new string('-', dots), new string('*', asteriks), new string('-',1));
  784.                     asteriks += 2;
  785.                    
  786.                 }
  787.                 asteriks = n-2;
  788.                 dots = 1;
  789.                 for (int k = 0; k < n / 2; k++)
  790.                 {                
  791.                     Console.WriteLine("{0}{1}{0}{2}{0}{1}{0}", new string('-', dots), new string('*', asteriks),new string('-', 1));
  792.                     dots++;
  793.                     asteriks -= 2;
  794.                    
  795.                 }
  796.  
  797.  
  798.  
  799.  
  800.  
  801.  
  802. 20 Dekemvri LODKA - boat /////////////////////////////////////////////////////////////////////////////////////////
  803.                
  804.                
  805.                 // LODKA
  806.             int n = int.Parse(Console.ReadLine());
  807.  
  808.             //top first haff
  809.             int sailCurrentW = 1;
  810.             int ppp = n-1;
  811.  
  812.  
  813.             for (int i = 0; i < n/2 +1; i++)
  814.             {
  815.                 //Console.Write("{0}",new string('.',ppp ));
  816.                 //Console.Write("{0}",new string('*', sailCurrentW));
  817.                 //Console.WriteLine("{0}",new string('.', n));
  818.                
  819.                 Console.WriteLine("{0}{1}{2}", new string('.', ppp), new string('*', sailCurrentW), new string('.', n));
  820.                 ppp -=2;
  821.                 sailCurrentW += 2;
  822.                
  823.             }
  824.             // bot second haff
  825.             int inner = n - 2;
  826.             int outer = 2;
  827.             for (int i = 0; i < n / 2; i++)
  828.             {
  829.                 //Console.Write("{0}", new string('.', outer));
  830.                 //Console.Write("{0}", new string('*', inner));
  831.                 //Console.WriteLine("{0}", new string('.', n));
  832.                
  833.                 Console.WriteLine("{0}{1}{2}", new string('.', ppp), new string('*', sailCurrentW), new string('.', n));
  834.                 outer += 2;
  835.                 inner -= 2;
  836.  
  837.             }
  838.             //bot
  839.             int boatHeight = n / 2;
  840.             int boatWidth = n + n;
  841.             int dots = 0;
  842.             for (int i = 0; i < boatHeight; i++)
  843.             {
  844.                 Console.Write("{0}", new string('.', dots));
  845.                 Console.Write("{0}", new string('*', boatWidth));
  846.                 Console.WriteLine("{0}", new string('.', dots));
  847.  
  848.                 boatWidth -= 2;
  849.                 dots++;
  850.             }
  851.         }
  852.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement