Advertisement
myname0

практикум 5 V 6

Sep 18th, 2015
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.67 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace практикум5_V
  8. {
  9.     class Program
  10.     {
  11.         static void rec(int i, int n)
  12.         {
  13.             int j;
  14.             if (i <= n)
  15.             {
  16.                 for (j = 1; j <= i; j++)
  17.                     Console.Write("{0} ", i);
  18.                 Console.WriteLine();
  19.                 rec(++i, n);
  20.             }
  21.         }
  22.  
  23.         static void Main(string[] args)
  24.         {
  25.             Console.Write("Enter n: ");
  26.             int n = int.Parse(Console.ReadLine());
  27.             int i = 1;
  28.             rec(i,n);
  29.         }
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement