当前位置: 首页>>代码示例>>C#>>正文


C# Paint.CountFor方法代码示例

本文整理汇总了C#中System.Paint.CountFor方法的典型用法代码示例。如果您正苦于以下问题:C# Paint.CountFor方法的具体用法?C# Paint.CountFor怎么用?C# Paint.CountFor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Paint的用法示例。


在下文中一共展示了Paint.CountFor方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Main

        static void Main(string[] args)
        {
            string inputname = args[0];
            string outputname = args[1];

            string[] lines = File.ReadAllLines(inputname);

            int ncases = int.Parse(lines[0]);
            int nline = 0;
            IList<string> results = new List<string>();
            Paint paint = new Paint();

            for (int k = 0; k < ncases; k++)
            {
                System.Console.WriteLine(string.Format("Solving Case #{0}", k + 1));
                nline++;
                string[] numbers = lines[nline].Split(' ');
                long radius = long.Parse(numbers[0]);
                long pnt = long.Parse(numbers[1]);
                long result = paint.CountFor(radius, pnt);
                results.Add(string.Format("Case #{0}: {1}", k + 1, result));
            }

            File.WriteAllLines(outputname, results.ToArray());
        }
开发者ID:ajlopez,项目名称:TddRocks,代码行数:25,代码来源:Program.cs

示例2: CountForRadiusThreePaintForty

        public void CountForRadiusThreePaintForty()
        {
            Paint paint = new Paint();

            Assert.AreEqual(3, paint.CountFor(3, 40));
        }
开发者ID:ajlopez,项目名称:TddRocks,代码行数:6,代码来源:PaintTests.cs

示例3: CountForRadiusOnePaintTen

        public void CountForRadiusOnePaintTen()
        {
            Paint paint = new Paint();

            Assert.AreEqual(2, paint.CountFor(1, 10));
        }
开发者ID:ajlopez,项目名称:TddRocks,代码行数:6,代码来源:PaintTests.cs

示例4: CountForRadiusOnePaintNine

        public void CountForRadiusOnePaintNine()
        {
            Paint paint = new Paint();

            Assert.AreEqual(1, paint.CountFor(1, 9));
        }
开发者ID:ajlopez,项目名称:TddRocks,代码行数:6,代码来源:PaintTests.cs

示例5: CountForRadiusOnePaint1000000000000000000

        public void CountForRadiusOnePaint1000000000000000000()
        {
            Paint paint = new Paint();

            Assert.AreEqual(707106780, paint.CountFor(1, 1000000000000000000));
        }
开发者ID:ajlopez,项目名称:TddRocks,代码行数:6,代码来源:PaintTests.cs

示例6: CountForRadius10000000000000000Paint1000000000000000000

        public void CountForRadius10000000000000000Paint1000000000000000000()
        {
            Paint paint = new Paint();

            Assert.AreEqual(49, paint.CountFor(10000000000000000, 1000000000000000000));
        }
开发者ID:ajlopez,项目名称:TddRocks,代码行数:6,代码来源:PaintTests.cs


注:本文中的System.Paint.CountFor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。