特牛生活网

剑指Offer第43题(n个骰子的点数)-CSDN博客

网友收藏
文章浏览阅读127次。(本博客旨在个人总结回顾)题目描述: 把n个骰子扔在地上,所有骰子朝上一面的点数之和为s。输入n,打印出s的所有可能值出现的概率。解法一:递归解法#include "stdafx.h"#include<iostream>using namespace std;int g_maxValue = 6;void Probability(int or...