﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace RandomizeTheNumbersOneToN
{
    class Program
    {
        static void Main()
        {
            Console.Write("Please enter n: ");
            int n = int.Parse(Console.ReadLine());

            Random r = new Random();
            List<int> numbers = new List<int>();

            for (int i = 1; i <= n; i++)
            {
                numbers.Add(i);
            }

            while (numbers.Count != 0)
            {
                int valueToTake = r.Next(1, n + 1);

                if (numbers.Contains(valueToTake))
                {
                    Console.Write("{0} ", valueToTake);
                    numbers.Remove(valueToTake);
                }
            }

            Console.WriteLine();
        }
    }
}
