#include<iostream>
#include<conio.h>
using namespace std;
int main()
{
	double Numbers[15]={0};
	int Counts[15]={0};
	//tarife pointer
	double *a, *MaxRepeatedNumber;
	int *i, *j, *EmptyCellIndex, *CountOfRepeat;
	//gereftane fazaye hafeze baraye pointer ha
	a = new double;
	MaxRepeatedNumber = new double;
	i = new int;
	j = new int;
	EmptyCellIndex = new int;
	CountOfRepeat = new int;

	//pardazesh barname
	*EmptyCellIndex = 0;
	*CountOfRepeat = 0;
	cout << "tedade 15 adad vared konid : ";
	for(*i=0; *i < 15; (*i)++)
	{
		//daryaft vorodi
		cin >> *a;
		//ezafe kardan tedad dar araye Counts agar vorodi tekrar dasht
		for(*j=0; *j < *EmptyCellIndex; (*j)++)
			if(Numbers[*j] == *a)
			{
				Counts[*j]++;
				break;
			}
		//ezafe kardan tedad dar araye Counts baraye vorodi jadid va Zakhire dar araye Numbers
		if(*j == *EmptyCellIndex)
		{
			Numbers[*EmptyCellIndex] = *a;
			Counts[*EmptyCellIndex]++; 
			(*EmptyCellIndex)++;
		}
	}
	//peida kardan adad bishtarin tekrar
	for(*i=0; *i < 15; (*i)++)
		if(Counts[*i] > *CountOfRepeat)
		{
			*CountOfRepeat = Counts[*i];
			*MaxRepeatedNumber = Numbers[*i];
		}
	cout << "Natije = " << *MaxRepeatedNumber << ", Tedade Tekrar = " << *CountOfRepeat << endl;

	//azad sazi fazaye hafeze baraye pointer ha
	delete a;
	delete MaxRepeatedNumber;
	delete i;
	delete j;
	delete EmptyCellIndex;
	delete CountOfRepeat;

	getch();
}

