相关文章推荐
考研的西红柿  ·  curl: (7) Failed to ...·  9 月前    · 
好帅的山羊  ·  使用class weight和sample ...·  2 年前    · 
代码如下:usingSystem;usingSystem.Collections.Generic;usingSystem.Text;namespacetestPoint{classProgram{staticvoidMain(string[]args){PointQ=newPoint(2,3,4);PointQ1=newPoin... 代码如下:
using System;
using System.Collections.Generic;
using System.Text;

namespace testPoint
{
class Program
{
static void Main(string[] args)
{
Point Q = new Point(2,3,4);
Point Q1 = new Point(2, 3, 3);

Console.WriteLine(Q.distance(Q1) );
Console.ReadKey();
}
}

class Point
{
public static int x,y,z;
public Point (int a,int b,int c)
{
x=a;y=b;z=c;
}
public void setX(int a)
{x=a;}
public void setY(int b)
{y = b; }
public void setZ(int c)
{z = c; }
public int distance(Point p)
{

return (x - p.x) * (x - p.x) + (y - p.y) * (y - p.y) + (z - p.z) * (z - p.z);
}
}
}
问题在哪呢?谢谢,希望高手详细指点下,谢谢。