예제 #1
0
    static void Main()
    {
        Decompose ob = new Decompose();
        int       i;
        double    f;

        i = ob.GetParts(10.125, out f);
        Console.WriteLine("Integer portion is " + i);
        Console.WriteLine("Fractional part is " + f);
    }
예제 #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Введите число : ");
            string input = Console.ReadLine();
            double n     = Convert.ToDouble(input);
            int    whole;
            double frac;

            whole = Decompose.GetParts(n, out frac);

            Console.WriteLine("Целая часть = {0}; дробная часть числа = {1}", whole, frac);
        }