问题描述扔n个骰子,向上面的数字之和为S。给定Givenn,请列出所有可能的S值及其相应的概率。样例给定n=1,返回[[1,0.17],[2,0.17],[3,0.17],[4,0.17],[5,0.17],[6,0.17]]。publicclassSolution{/***@paramnaninteger*@returnalistofMap.Entry */publicList>dicesSum(intn){ //Writeyourcodehere//Ps.newAbstractMap.SimpleEntry(sum,pro) //tocreatethepair}}
互换的青春
守着一只汪
随时随地看视频慕课网APP
相关分类