#include <iostream>
#include <cstdlib>
using namespace std;

const int REPEATS = 1000;

int main() {
	int matches = 0;
	for(int repeat = 0; repeat<REPEATS; repeat++) {
		srand(time(NULL));
		int x = rand()%1000000;
		srand(time(NULL));
		int y = rand()%1000000;
		if(x==y){ //імовірність цієї події близька до 100%
			matches++;
		}
	}
	cout<<"matches: "<<matches<< " P(x==y)=" << double(matches)/REPEATS;
	return 0;
}