Make a negative number positive

前端 未结 0 332
北海茫月
北海茫月 2020-12-23 06:12

I have a Java method in which I\'m summing a set of numbers. However, I want any negatives numbers to be treated as positives. So (1)+(2)+(1)+(-1) should equal 5.

I

相关标签:
回答
  • 消灭零回复
提交回复
热议问题