Beispiel #1
0
        public void Samples1()
        {
            var start = 1000;
            var sb    = new StringBuilder();

            for (int k = 2; k < 3; k++)
            {
                for (int i = 8000; i < 9999; i++)
                {
                    var result     = NumberOfIntegersInt.getNumberOfIntegers(start, i, k);
                    var calculated = NumberOfIntegersBigInteger.getNUmberOfIntergerUpper(i.ToString().Select(c => c - '0').ToList(), k);
                    sb.AppendLine($"{start}-{i}, K:{k}: {result} {calculated}");
                }
            }
            File.WriteAllText("test.txt", sb.ToString());
        }
        public void TestBigInteger(string L, string R, int K, int expected)
        {
            var result = NumberOfIntegersBigInteger.getNumberOfIntegers(L, R, K);

            Assert.Equal(expected, result);
        }
 public void TestNumberOfIntegerOk(int n, int k, int expected)
 {
     Assert.Equal(expected, NumberOfIntegersBigInteger.getNumberOfInteger(n, k));
 }