日期:2011-07-20  浏览次数:20396 次

using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            for (int i = 1; i < 10; i++)
            {
                Console.Write("{0}:    ", i);
                for (int k = 1; k <= i; k++)
                {
                    Console.Write("{0}" + "  ", i * k);
                }
              
              
                Console.WriteLine();
            }
            string str = "620102197811196218";
            CheckCid t = new CheckCid();
            string str1 = t.CheckCidInfo(str);
            Console.Write(str1);
        }

        /// <summary>
        /// 15 to 19
        /// </summary>
        public class IDCard
        {
            // wi =2(n-1)(mod 11)
            int[] wi = new int[] { 7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2, 1 };
            // verify digit
            int[] vi = new int[] { 1, 0, 'X', 9, 8, 7, 6, 5, 4, 3, 2 };
            private int[] ai = new int[18];
            public IDCard()
            {
            }
            //verify
            public string Verify(string idcard)
            {
                string strCard = "";
                if (idcard.Length == 15)
                {
                    strCard = uptoeighteen(idcard);
                }