class Point{ public double x,y; Point(double x,double y){ th
来源:学生作业帮 编辑:大师作文网作业帮 分类:综合作业 时间:2024/11/12 06:01:58
class Point{ public double x,y; Point(double x,double y){ this.x=x; this.y=y; } static void show(){
老是出错,感激不尽
class Point{
public double x,y;
Point(double x,double y){
this.x=x;
this.y=y;
}
static void show(){
System.out.println("x="+x+" ");
System.out.println("y="+y+" ");
}
}
public class Point1{
public static void main(String[] args){
Point p1=new Point(15,18);
Point p2=new Point(12,16);
new Point(p1,p2);
p1.show();
p2.show();
getMiddle()
{x=(p1.x+p2.x)/2;
y=(p1.y+p2.y)/2;
Point.show();
}
}
}
老是出错,感激不尽
class Point{
public double x,y;
Point(double x,double y){
this.x=x;
this.y=y;
}
static void show(){
System.out.println("x="+x+" ");
System.out.println("y="+y+" ");
}
}
public class Point1{
public static void main(String[] args){
Point p1=new Point(15,18);
Point p2=new Point(12,16);
new Point(p1,p2);
p1.show();
p2.show();
getMiddle()
{x=(p1.x+p2.x)/2;
y=(p1.y+p2.y)/2;
Point.show();
}
}
}
class Point{
public double x,y;
Point(double x,double y){
this.x=x;
this.y=y;
}
void show(){
System.out.println("x="+x+" ");
System.out.println("y="+y+" ");
}
}
public class Point1{
public static void main(String[] args){
Point p1=new Point(15,18);
Point p2=new Point(12,16);
p1.show();
p2.show();
Point p3=getMiddle(p1,p2);
p3.show();
}
static Point getMiddle(Point p1,Point p2)
{
\x05 double x=(p1.x+p2.x)/2;
double y=(p1.y+p2.y)/2;
return new Point(x,y);
}
}
public double x,y;
Point(double x,double y){
this.x=x;
this.y=y;
}
void show(){
System.out.println("x="+x+" ");
System.out.println("y="+y+" ");
}
}
public class Point1{
public static void main(String[] args){
Point p1=new Point(15,18);
Point p2=new Point(12,16);
p1.show();
p2.show();
Point p3=getMiddle(p1,p2);
p3.show();
}
static Point getMiddle(Point p1,Point p2)
{
\x05 double x=(p1.x+p2.x)/2;
double y=(p1.y+p2.y)/2;
return new Point(x,y);
}
}
class Point{ public double x,y; Point(double x,double y){ th
class Point{ private double x; private double y; Point(doubl
类定义为什么要这样class point{public:double x,y;point(){};point(doubl
已知有如下类的定义:public class Point { private double x,y; public Po
java问题..谢谢lass Point { double x,y,z; Point(double _x,double
class Point{ protected int x,y; public Point(){} public Poin
double x=1.0 double y=5.0 double
double pow(double x,double y) C语言
C语言数字排序#include void sort3(double *x,double *y,double *z);in
#include double s(double x); void main() { double a,y; scanf
double fun(int i,double x,double
double x=1.52,y=5.