睡觉的神吧 关注:7贴子:426
  • 2回复贴,共1
private void TestBtn_Click(object sender, EventArgs e)
{
// MessageBox.Show((21425712 / 66).ToString());
// MessageBox.Show((21425712 / 66/7).ToString());
int JianGeQu = 21425712 / 66 / 7;
for (int i = 0; i < 2000; i++)
{
Random rd = new Random(i);
DuiYingShu.Add(rd.Next(1, 21425712).ToString());
}
for (int i = 0; i < DuiYingShu.Count; i++)
{
YaSuoDuiYingShu.Add(Convert.ToInt32(DuiYingShu[i]) % JianGeQu);
}
for (int i = 0; i < DuiYingShu.Count; i++)
{
OutRTBox.AppendText( YaSuoDuiYingShu[i].ToString ()+ Environment.NewLine);
}
}


IP属地:天津1楼2018-07-24 20:10回复
    private void LiangDianJuLiBtn_Click(object sender, EventArgs e)
    {
    Point a =new Point (0, 1);
    Point b = new Point(0, 2);
    double r= GetDistance(a, b);
    MessageBox.Show(r.ToString ());
    }
    public static double GetDistance(Point startPoint, Point endPoint)//得到两点间距离
    {
    int x = System.Math.Abs(endPoint.X - startPoint.X);
    int y = System.Math.Abs(endPoint.Y - startPoint.Y);
    return Math.Sqrt(x * x + y * y);
    }


    IP属地:天津2楼2018-07-24 20:11
    回复
      IP属地:天津来自Android客户端3楼2019-03-01 21:42
      回复