编程求指定半径r的圆的面值和周长,并输出计算结果

来源:互联网 发布:实时对讲软件 编辑:程序博客网 时间:2024/04/30 11:34
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace _2._3._1
{
    class Program
    {
        static void Main(string[] args)
        {
            double a, b, r;
            r = 5;
            
            a = Math.Pow(r, 2) *Math. PI;
            b = 2 * r *Math. PI;
            Console.WriteLine("圆的面值{0}",a);
            Console.WriteLine("圆的周长{0}",b);
            Console.Read();
            


        }
    }
}
0 0
原创粉丝点击