Advertisement
Guest User

Kaspichania Boats

a guest
Mar 11th, 2014
342
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.78 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Caspichania
  4. {
  5.     class caspichan
  6.     {
  7.         static void Main()
  8.         {
  9.             int n = int.Parse(Console.ReadLine());
  10.             int dotCount = n;
  11.             int innerDotCount = 0;
  12.             int width = n * 2 + 1;
  13.             int height = 6 + ((n - 3) / 2) * 3;
  14.             for (int i = 1; i <= height; i++)
  15.             {
  16.                 string outerDots = new string('.', dotCount);
  17.                 string innerDots = new string('.', innerDotCount);
  18.                 if (i != n + 1&&i!=height)
  19.                 {
  20.                     Console.Write(outerDots);
  21.                     if (i == 1) Console.Write('*');
  22.                     else
  23.                         if (i == 2) Console.Write("***");
  24.                         else
  25.                         {
  26.                             Console.Write('*');
  27.                             Console.Write(innerDots);
  28.                             Console.Write('*');
  29.                             Console.Write(innerDots);
  30.                             Console.Write('*');
  31.                         }
  32.                     Console.Write(outerDots);
  33.                 }
  34.                 if(i==n+1) {string fullStars = new string('*',width);Console.Write(fullStars);}
  35.                 if (i == height)
  36.                 {
  37.                     Console.Write(outerDots);
  38.                     string lastStars = new string('*', width - (2 * dotCount));
  39.                     Console.Write(lastStars);
  40.                     Console.Write(outerDots);
  41.                 }
  42.                 if(i<n) {dotCount--;}
  43.                 if(i>n+1) {dotCount++;}
  44.                 if(i>1&&i<n) {innerDotCount++;}
  45.                 if(i>n+1) {innerDotCount--;}
  46.                 Console.WriteLine();
  47.                
  48.             }
  49.         }
  50.     }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement