It's just for calculating the number of times different sums appear on throw of two dices.
#include<iostream>
using namespace std;
int main()
{
int a[]={2,3,4,5,6,7,8,9,10,11,12};
int b[11]={};
for(int i=0;i<359;i++)
{int c=(rand()%6+1)+(rand()%6+1);
if(c=a[c-2])b[c-2]++;}
for(int i=0;i<11;i++)
cout<<b[i]<<endl;
cin.get();
}


Sign In
Create Account


Back to top









