标题:C#学生遇到程序调试异常,求精通大神帮忙
取消只看楼主
相信自己xcc
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2015-11-20
结帖率:0
已结贴  问题点数:20 回复次数:1 
C#学生遇到程序调试异常,求精通大神帮忙
using System;
using System.Collections.Generic;
using
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 Form1_Load(object sender, EventArgs e)
        {
            
            int x1 = Convert.ToInt32(textBox2.Text);
            int y1 = Convert.ToInt32(textBox1.Text);
           int x2 = Convert.ToInt32(textBox3.Text);
            int y2 = Convert.ToInt32(textBox4.Text);
            Point p1 = new Point(x1, y1);
            Point p2 = new Point(x2, y2);
            label7.Text = p1.Distance(p2).ToString();

        }
        class Point
        {
            public int X, Y;
            public Point(int I, int J) { X = I; Y = J; }
            public double Distance(Point p)
            {
                return System.Math.Sqrt((this.X - p.X) * (this.X - p.X) + (this.Y - p.Y) * (this.Y - p.Y));
    }
        }
    }
}
搜索更多相关主题的帖子: private public 
2015-11-20 15:54
相信自己xcc
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2015-11-20
得分:0 
回复 2楼 Javama
还是不太明白,详细说下吧怎么改呢
2015-11-20 16:03



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-459409-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.026300 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved