Advertisement
hristo_bratanov

Copyright symbol triangle

Oct 6th, 2012
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.77 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.  
  8. class CopyrightTriangle
  9. {
  10.     static void Main()
  11.     {
  12.         Console.OutputEncoding = Encoding.UTF8;
  13.         int n = 4;
  14.         Console.Write(new string(' ',n-1));  // first row
  15.         Console.WriteLine('\u00A9');
  16.         for (int row = 1; row < n-1; row++)
  17.         {
  18.             Console.Write(new string(' ', n-row-1));
  19.             for (int col = 0; col < 2; col++)
  20.             {
  21.                  Console.Write('\u00A9' + new string(' ', 2*row-1));
  22.             }
  23.             Console.WriteLine();
  24.         }
  25.  
  26.         // last row
  27.         for (int i = 1; i <= n; i++)
  28.         {
  29.             Console.Write('\u00A9'+" ");
  30.         }
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement