S001-AC.cc 1.42 KB
#include <iostream>
#include <iomanip>

using namespace std;

int main()
{
	int e,c;

	cin >> e;
	cin >> c;

	int quinientos = e / 500;
	e -= quinientos*500;

	int doscientos = e / 200;
	e -= doscientos*200;

	int cien = e / 100;
	e -= cien*100;

	int cincuenta = e / 50;
	e -= cincuenta*50;

	int veinte = e / 20;
	e -= veinte*20;

	int diez = e / 10;
	e -= diez*10;

	int cinco = e / 5;
	e -= cinco*5;

	int dos = e / 2;
	e -= dos*2;

	int uno = e;

	int cincuentac = c / 50;
	c -= cincuentac*50;

	int veintec = c / 20;
	c -= veintec*20;

	int diezc = c / 10;
	c -= diezc*10;

	int cincoc = c / 5;
	c -= cincoc*5;

	int dosc = c / 2;
	c -= dosc*2;

	int unoc = c;

	cout << "Banknotes of 500 euros: " << quinientos << endl;
	cout << "Banknotes of 200 euros: " << doscientos << endl;
	cout << "Banknotes of 100 euros: " << cien << endl;
	cout << "Banknotes of 50 euros: " << cincuenta << endl;
	cout << "Banknotes of 20 euros: " << veinte << endl;
	cout << "Banknotes of 10 euros: " << diez << endl;
	cout << "Banknotes of 5 euros: " << cinco << endl;
	cout << "Coins of 2 euros: " << dos << endl;
	cout << "Coins of 1 euro: " << uno << endl;
	cout << "Coins of 50 cents: " << cincuentac << endl;
	cout << "Coins of 20 cents: " << veintec << endl;
	cout << "Coins of 10 cents: " << diezc << endl;
	cout << "Coins of 5 cents: " << cincoc << endl;
	cout << "Coins of 2 cents: " << dosc << endl;
	cout << "Coins of 1 cent: " << unoc << endl;

	return 0;
}