求助大佬,一个接近十年前玩的java僵尸游戏

2024-07-19 10:15:46作者:饭克斯

publicclassTriangle{

doublex,y,a;

publicTriangle(doublex,doubley,doublea){

this.x=x;

this.y=y;

this.a=a;

}

publicvoidsetA(doublea){

this.a=a;

}

publicdoublegetArea(){

return0.5*x*y*Math.sin(Math.toRadians(a));

}

}publicclassTestTriangle{

publicstaticvoidmain(String[]args){

Triangletriangle=newTriangle(3.0,6.0,30.0);

System.out.println(triangle.getArea());

triangle.setA(90.0);

System.out.println(triangle.getArea());

}

}

展开全文

热门推荐

相关攻略

猜你喜欢