java random percentages

后端 未结 0 1626
星月不相逢
星月不相逢 2021-02-12 18:38

I need to generate n percentages (integers between 0 and 100) such that the sum of all n numbers adds up to 100.

If I just do nextInt() <

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