Advertisement
AnitaN

02.PrimitiveDataTypesVariables/09.IsoscelesTriangle

Mar 9th, 2014
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.89 KB | None | 0 0
  1. //Problem 9.    Isosceles Triangle
  2. //Write a program that prints an isosceles triangle of 9 copyright symbols ©, something like this:
  3. //Note that the © symbol may be displayed incorrectly at the console so you may need to change the console character encoding to UTF-8 and the console font.
  4.  
  5. using System;
  6. using System.Text;
  7.  
  8. class IsoscelesTriangle
  9. {
  10.     static void Main()
  11.     {
  12.         Console.OutputEncoding = Encoding.Unicode;
  13.         int copyRightSymbol = 169;
  14.  
  15.         //Simple Variant
  16.         Console.WriteLine(" " + " " + " " + (char)copyRightSymbol);
  17.         Console.WriteLine(" " + " " + (char)copyRightSymbol + " " + (char)copyRightSymbol);
  18.         Console.WriteLine(" " + (char)copyRightSymbol + " " + " " + " "+ (char)copyRightSymbol);
  19.         Console.WriteLine((char)copyRightSymbol + " " + (char)copyRightSymbol + " " +(char)copyRightSymbol + " " +(char)copyRightSymbol);
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement