要求:

1、不得使用任何API,如Math.abs()等。
2、不得使用判断语句,如if、for、while、switch、?:等。
3、不得使用比较语句,如:==、<=、>=、!=、<、>等。

正解:Java code

public static int abc(int num)

{

  return num*(1-((num>>>31)<<1));

}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-09
  • 2021-12-24
  • 2022-12-23
猜你喜欢
  • 2022-02-16
  • 2022-03-01
  • 2021-11-27
  • 2021-10-02
  • 2021-08-29
相关资源
相似解决方案