Untitled

                Never    
C#
       
using System;
using System.Collections.Generic;

namespace PESEL
{
    class Program
    {
        protected static void Take_pesel(string t)
        {
            int number;
            List<long> lista_PESELI = new List<long>();

            while (int.TryParse(t, out number) == false || (number > 100 || number <= 0))
            {
                Console.WriteLine("Podałeś złą wartość. Podana liczba musi leżeć w przedziale od 1 do 100.");
                t = Console.ReadLine();

            }

            for (int i = 0; i < number; i++)
            {
                string kolejne_pesele = Console.ReadLine();
                long numer_pesel;

                while (long.TryParse(kolejne_pesele, out numer_pesel) == false || kolejne_pesele.Length != 11)
                {
                    Console.WriteLine("Podany numer PESEL jest zbyt długi/krótki. PESEL składa się z 11 liczb. Wprowadź poprawny numer PESEL: ");
                    kolejne_pesele = Console.ReadLine();
                }

                lista_PESELI.Add(numer_pesel);

            }

            foreach (long p in lista_PESELI)
            {
                if (Check_pesel(p) == true)
                {
                    Console.WriteLine("D");
                }
                else
                {
                    Console.WriteLine("N");
                }
            }

        }
        protected static bool Check_pesel(long to_check)
        {
            int sum = 0;
            long constant = 13791379131;

            do
            {
                int x = (int)(constant % 10);
                int y = (int)(to_check % 10);

                sum += (x * y);

                constant /= 10;
                to_check /= 10;

            } while (constant > 0);

            if (sum == 0 || (sum % 10) == 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }


        static void Main(string[] args)
        {
            
            Console.WriteLine("Podaj ilość PESELi jaką chcesz sprawdzić: ");
            string t = Console.ReadLine();

            Take_pesel(t);


            Console.ReadKey();
        }
    }
}

Raw Text