public class TestNewCalc {
  //奥数中的定义新运算
  //对应java的方法
  
  public float yuanQuanJia(float a,float b){
   if(a>b){
    return a;
   }else if(a==b){
    return 1;
   }else if(a<b){
    return b;
   }  
   return 0;//永远不会执行的
  }
  
 }

 //测试类

public class Text {
  //Alt+/
 //程序的入口
 public static void main(String[] args){
  TestNewCalc t=new TestNewCalc();
  float f=t.yuanQuanJia(3.5f, 2);
  //float f=t.yuanQuanJia(1f,1.2f);
  //float f=t.yuanQuanJia(7f,7f);
  System.out.println(f);
 }
}

相关文章:

  • 2021-10-24
  • 2022-12-23
  • 2022-12-23
  • 2021-12-31
  • 2022-12-23
  • 2021-12-28
猜你喜欢
  • 2021-12-31
  • 2021-06-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-10
  • 2022-01-26
相关资源
相似解决方案