using System.Collections.Generic;
using System.Threading.Tasks;
static string rezult = "";
public static void rec0(string[] posled, int n_poslled)
if (n_poslled <= 0) return;
posled[n_poslled - 1] = n_poslled.ToString();
public static void rec1(string[] posled, int n_poslled, int static_n_poslled)
rezult = rezult + posled[static_n_poslled - n_poslled];
rec1(posled, n_poslled, static_n_poslled);
public static void Main(string[] args)
string[] posled = new string[n_poslled+1];
rec1(posled, n_poslled, n_poslled);
for (int i=0; i < n_poslled; i++)
Console.Write(posled[i]+" ");
Console.WriteLine(rezult);