圆周长面积计算
实现代码:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace 实验二
{
public partial class Form1 : Form
{
string s;
const double PI = 3.1415926;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
s=textBox1.Text;
double x=double.Parse(s);
double c = 2 * PI * x;
double m = PI * x * x;
textBox2.Text = c.ToString() ;
textBox3.Text = m.ToString();
}
}
}