C# ACM poj1003

这题很有内涵,先用简单方法

 public static void acm1003(double a)

        {

            if (a==0)

            {

                return;

            }

            double b = 2;

            while (a > 0)

            {

                double c = 1 / b;

                a = a - c;

                b++;

            }

            Console.WriteLine(b - 2 + " card(s)");

        }

 

你可能感兴趣的:(ACM)