Math类常用函数及应用举例

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication6
{
    class Program
    {
        static void Main(string[] args)
        {
            //输入x,计算关于x的一元多次方程的值
            double x, y;
            Console.Write("x=");
            x = Convert.ToDouble(Console.ReadLine());
            y = Math.Pow(x, 3) + 2*Math.Pow(x, 2) + 8 * x - 9;
            Console.WriteLine("x^3-2*x^2+8*x-9=" + y);
        }
    }
}

posted @ 2012-09-15 10:24  roytanlu  阅读(227)  评论(0编辑  收藏  举报