public void test() { var tClass = new diao_zheng_shu_zu_shun_xu_shi_qi_shu_wei_yu_ou_shu_qian_mian_lcof(); var nums = new int[] { 1, 2, 3, 4 }; var res = tClass.Exchange(nums); Assert.IsTrue(IntExtent.ToString(res) == "1,3,2,4"); nums = new int[] { 1, 3, 5 }; res = tClass.Exchange(nums); Assert.IsTrue(IntExtent.ToString(res) == "1,3,5"); }
public string test(int R, int C, int r0, int c0) { return(IntExtent.ToString(target.AllCellsDistOrder(R, C, r0, c0))); }
//[Ignore("测试失败"),TestCase(new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8 }, ExpectedResult = "0,1,2,4,8,3,5,6,7")] //[TestCase(new int[] { 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1 }, ExpectedResult = "1,2,4,8,16,32,64,128,256,512,1024")] //[TestCase(new int[] { 10000, 10000 }, ExpectedResult = "10000,10000")] //[TestCase(new int[] { 2, 3, 5, 7, 11, 13, 17, 19 }, ExpectedResult = "2,3,5,17,7,11,13,19")] public string test_V4(int[] arr) { return(IntExtent.ToString(target.SortByBits_V4(arr))); }