效果
代码
int r= 5; //定义
double pi=3.14;
double perimeter=r * 2 * pi; //周长
double mj = pi * r * r; //面积
Console.WriteLine("圆的周长为{0},面积为{1}", perimeter, mj); //输出
Console.ReadKey();
int r= 5; //定义
double pi=3.14;
double perimeter=r * 2 * pi; //周长
double mj = pi * r * r; //面积
Console.WriteLine("圆的周长为{0},面积为{1}", perimeter, mj); //输出
Console.ReadKey();