#作业
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication3
{
class Program
{
static void Main(string[] args)
{
double r=5;//圆的半径
double area;//圆的面积
double perimeter;//圆的周长
System.Console.Write("请输入圆的半径:");
r = double.Parse(System.Console.ReadLine());
area = Math.PI * r * r;//计算圆的周长
perimeter = 2 * Math.PI * r;
System.Console.WriteLine("圆的面积为{0:f2}", area);
System.Console.WriteLine("圆的周长为{0:f2}", perimeter);
System.Console.ReadKey();
return;
}
}
}
网友评论