Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace практикум5_V
- {
- class Program
- {
- static void rec(int i, int n)
- {
- int j;
- if (i <= n)
- {
- for (j = 1; j <= i; j++)
- Console.Write("{0} ", i);
- Console.WriteLine();
- rec(++i, n);
- }
- }
- static void Main(string[] args)
- {
- Console.Write("Enter n: ");
- int n = int.Parse(Console.ReadLine());
- int i = 1;
- rec(i,n);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement