Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public class Program
- {
- public static void Main()
- {
- int n = int.Parse(Console.ReadLine());
- int num = 1;
- for (int row = 1; row <= n; row++)
- {
- for (int col = 1; col <= row; col++)
- {
- Console.Write(num + " ");
- num++;
- if (num > n)
- {
- return;
- }
- }
- Console.WriteLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement