Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Write a program that prints an isosceles triangle of 9
- * copyright symbols ©. Use Windows Character
- * Map to find the Unicode code of the © symbol.
- * Note: the © symbol may be displayed incorrectly.
- */
- using System;
- class IsoscelesTriangle
- {
- static void Main()
- {
- char copyrightChar = '\u00A9';
- int rows = 3;
- int cols = 4;
- for (rows = 1; rows < cols; rows++)
- {
- if(rows == 1)
- {
- for (int line = 1; line < cols - rows; line++)
- {
- Console.Write(" ");
- }
- Console.WriteLine("{0}",copyrightChar);
- }
- if (rows == 2)
- {
- for (int line = 1; line < cols - rows; line++)
- {
- Console.Write(" ");
- }
- Console.WriteLine("{0}{0}{0}",copyrightChar);
- }
- if (rows == 3)
- {
- for (int line = 1; line < cols - rows; line++)
- {
- Console.Write(" ");
- }
- Console.WriteLine("{0}{0}{0}{0}{0}\n", copyrightChar);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment