Advertisement
Siropo

simple Triangle

Nov 3rd, 2012
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.75 KB | None | 0 0
  1. using System;
  2. using System.Text;
  3.  
  4. class task9
  5. {
  6.     static void Main()
  7.     {
  8.         char copyRightSymbol = (char)169;
  9.         Console.OutputEncoding = Encoding.Unicode;
  10.  
  11.         int triangleHeight = 3;
  12.         int temp = triangleHeight * 2;
  13.         int temp2 = triangleHeight * 2;
  14.         int temp3 = 1;
  15.         int h;
  16.         int j;
  17.  
  18.         for (int i = 0; i < temp2; i += 2)
  19.         {
  20.             temp = (temp2 - temp3) % triangleHeight;
  21.             for (j = temp; j > 0; j--)
  22.             {
  23.                 Console.Write(" ");  
  24.             }
  25.             for (h = 1; h < i + 2; h++)
  26.             {
  27.                 Console.Write(copyRightSymbol);  
  28.             }
  29.             Console.WriteLine();
  30.             temp3++;
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement