判断是否是闰年

来源:互联网 发布:全息瞄准镜 知乎 编辑:程序博客网 时间:2024/04/28 02:27
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace ConsoleApplication2{    class Program    {        static void Main(string[] args)        {            double y, x;    //y:总值,x:数值            Console.WriteLine("请输入x的值");            x = Convert.ToDouble(Console.ReadLine());            if (x < 2) y = x;            else if (x < 6) y = Math.Pow(x, 2) + 1;            else if (x < 10) y = Math.Sqrt(x + 1);            else y = 1 / (x + 1);            Console.WriteLine("y的值:{0}", y);            Console.Read();        }    }}

0 0
原创粉丝点击