#include <iostream>
#include <iomanip>
int main()
{
int Numbers[11] = { 0 };
const int Max= 6;
const int Combinations = 36;
for( int d1 = 0; d1 < Max; ++d1 )
{
for( int d2 = 0; d2 < Max; ++d2 )
{
++Numbers[d1+d2];
}
}
std::cout << "Number\tTimesRolled\tPercentage" << std::endl;
for( int i = 0; i < 11; ++i )
{
std::cout << i + 2 << '\t' << Numbers[i] << '\t' <<
std::showpoint << std::setprecision(3) <<
(double)Numbers[i] / Combinations * 100 << '%' << std::endl;
}
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8aW9tYW5pcD4KCmludCBtYWluKCkKewoJaW50IE51bWJlcnNbMTFdID0geyAwIH07Cgljb25zdCBpbnQgTWF4PSA2OwoJY29uc3QgaW50IENvbWJpbmF0aW9ucyA9IDM2OwoJCglmb3IoIGludCBkMSA9IDA7IGQxIDwgTWF4OyArK2QxICkKCXsKCQlmb3IoIGludCBkMiA9IDA7IGQyIDwgTWF4OyArK2QyICkKCQl7CgkJCSsrTnVtYmVyc1tkMStkMl07CgkJfQoJfQoJCglzdGQ6OmNvdXQgPDwgIk51bWJlclx0VGltZXNSb2xsZWRcdFBlcmNlbnRhZ2UiIDw8IHN0ZDo6ZW5kbDsKCWZvciggaW50IGkgPSAwOyBpIDwgMTE7ICsraSApCgl7CgkJc3RkOjpjb3V0IDw8IGkgKyAyIDw8ICdcdCcgPDwgTnVtYmVyc1tpXSA8PCAnXHQnIDw8CgkJc3RkOjpzaG93cG9pbnQgPDwgc3RkOjpzZXRwcmVjaXNpb24oMykgPDwKCQkoZG91YmxlKU51bWJlcnNbaV0gLyBDb21iaW5hdGlvbnMgKiAxMDAgPDwgJyUnIDw8IHN0ZDo6ZW5kbDsKCX0KfQ==