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