All pastes #761897 Raw Edit

Untitled

public text v1 · immutable
·published 2007-11-05 03:45 UTC
rendered paste body
#include <iostream.h>
#include <H:\lvp\random.h>

int main()
{
	randomize();
	int rolls;
	int n1, n2;
	int numberofdoubles;

	cout << "How many rolls do you want to simulate? ";
	cin >> rolls;
	cout << endl;
	
	for (; rolls > 0; rolls--) {
	   n1 = (random(6) + 1);
	   n2 = (random(6) + 1);
       cout << n1 << " " << n2 << endl;
	   }

	   if (n1 == n2) {
		   numberofdoubles++;
	   }
      cout << "There were " << numberofdoubles << " doubles." << endl;
	return(0);
}