HTML & JS
#include <iostream>
using namespace std;


double dp[110];
int main() {
	int n =100;
	for(int i =1;i<=100;i++)
	    for(int d = 1;d<=6;d++)
	        dp[i +d]+=(dp[i] + 1)/6.0;
	        
	cout << dp[100]<<"\n";
	return 0;
}

Generated URL:

Output:

28.0476
Report Bug