首页 > 代码库 > c#第一个程序-计算平方根
c#第一个程序-计算平方根
上课教的内容。做笔记了。
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 { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { double a = double.Parse(textBox1.Text); double retrun = Math.Sqrt(a); label1.Text = a + "的平方跟是:" + retrun.ToString() ;//ToString转换字符串。 } private void Form1_Load(object sender, EventArgs e) { } }}
c#第一个程序-计算平方根
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。