C#作业6

#作业要求

计算半径为5的圆的面积和周长并打印出来。

#代码

using System;

using System.

Collections.Generic;

using System.Linq;

using System.Text;

namespace ConsoleApplication1 {

class Program {

static void Main(string[] args) {

int bj = 5;

double pi = 3.14;

double mj = pi * bj * bj;

double Perimeter = 2 * pi * bj;

Console.WriteLine("圆的面积是{0},圆的周长是{1}",mj,Perimeter);

Console.ReadKey();} } }

#效果

C#作业6_第1张图片
图片发自App

你可能感兴趣的:(C#作业6)