Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Test2
- {
- class MainClass
- {
- public static void Main (string[] args)
- {
- int n = int.Parse (Console.ReadLine ());
- for (int row = 0; row <n; row++) {
- for (int col = 0; col < n-row-1; col++) {
- Console.Write(" ");
- }
- for (int j = 0; j < row+1; j++) {
- Console.Write ("* ");
- }
- Console.WriteLine ();
- }
- for (int row = 1; row < n; row++) {
- for (int i = 0; i < row; i++) {
- Console.Write (" ");
- }
- for (int j = 0; j < n-row; j++) {
- Console.Write ("* ");
- }
- Console.WriteLine ();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment