Guest User

https://ehazi.hu/q/21541

a guest
Feb 21st, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.49 KB | None | 0 0
  1. using System;
  2.  
  3. namespace P02
  4. {
  5.     class Program
  6.     {
  7.         public static void Main(string[] args)
  8.         {
  9.  
  10.             Console.Title="n elem pramis alakba";
  11.             int sor=1, a=1, n=47;
  12.             for (int i = 1; i <= n; i++) {
  13.                 Console.Write("{0,2} ",i);
  14.                 if (sor==a) {
  15.                     sor++;
  16.                     a=1;
  17.                     Console.WriteLine();
  18.                 }
  19.                 else a++;
  20.             }
  21.  
  22.            
  23.             Console.Write("\n\nPress any key to continue . . . ");
  24.             Console.ReadKey(true);
  25.         }
  26.     }
  27. }
Add Comment
Please, Sign In to add comment