using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace test
{
    class Program
    {
        static void Main()
        {
            int[] i = {0,1,2,3,4,5,6,7,8,9};
            int[] j=new int[10];
            for (int k = 0; k < i.Length;k++ )
            {
                j[k] = ~i[k];
                Console.Write(j[k]+" ");
            }
            Console.WriteLine();
            foreach (int k in i)
            {
                Console.Write(k + "  ");
            }
            Console.WriteLine();
        }
    }
}                                    //取补即原数加1取负


本文转载:CSDN博客