#include <iostream.h>



/****************************************************/
/**** برنامج يحول المبلغ المدخل الى عدد من الفئات ***/
/****  كتبه السهم الناري ****************************/
/****************************************************/


void PrintClasses();



int main()
{
	
	PrintClasses();
	return 0;
}



void PrintClasses()
{
	int Classes[8] = { 500,200,100,50,20,10,5,1 };
	int Count[8];
	int Mony;

	for( int i=0; i<8; i++ )
		Count[i] = 0;

	cout << "Enter Mony Not Zero : ";
	cin  >> Mony;

	i = 0;	

	while( Mony != 0 )
	{
		
		Count[i] = Mony / Classes[i];
		Mony =  Mony % Classes[i];
		i++;

	}

	for( i=0; i<8; i++ )
	{
		cout << "\n\t " << Classes[i] << "\t : " << Count[i]; 
	}

	cout << "\n\n\n";


}
