visual c#.NET程序设计课后习题部分答案
二、3(1).
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 WindowsFormsApplication1
{public partial class Form1 : Form {public Form1() {
InitializeComponent(); }
private void button1_Click(object sender, EventArgs e)
{label1.Text = \该圆的面积为:\ + 3.14159265 * float.Parse(textBox1.Text) *
float.Parse(textBox1.Text) + '\\n' + '\\n' + \该圆的周长为:\ + 2 * 3.14159265 * float.Parse(textBox1.Text);
}
private void textBox1_TextChanged(object sender, EventArgs e) { }
private void Form1_Load(object sender, EventArgs e) { }
private void label1_Click(object sender, EventArgs e) { } } }
二、3(2) using System;
using System.Collections.Generic; using System.Linq;
using System.Text;
namespace ConsoleApplication2
{class Program