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