#include <iostream>
using namespace std;
int main(){
float grn[] = {1.24, 0.56, .32, 1, 4.2};
size_t nom[] = {25, 10, 5, 1};//мають буди відсоротовані по зменшенню
size_t grn_size = sizeof(grn) / sizeof(grn[0]);
size_t nom_size = sizeof(nom) / sizeof(nom[0]);
for( size_t i = 0; i < grn_size; i++ )
{
size_t dif = grn[i]*100;
size_t cnt = 0;
cout<<grn[i]<<" : "<<endl;
for( size_t j = 0; dif && (j < nom_size); j++)
{
cnt = dif / nom[j];
cout<<nom[j]<<" = "<<cnt<<endl;
dif -= cnt*nom[j];
}
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwogCmludCBtYWluKCl7CiAgICBmbG9hdCAgZ3JuW10gPSB7MS4yNCwgMC41NiwgLjMyLCAxLCA0LjJ9OwogICAgc2l6ZV90IG5vbVtdID0gezI1LCAxMCwgNSwgMX07Ly/QvNCw0Y7RgtGMINCx0YPQtNC4INCy0ZbQtNGB0L7RgNC+0YLQvtCy0LDQvdGWINC/0L4g0LfQvNC10L3RiNC10L3QvdGOCiAgICBzaXplX3QgZ3JuX3NpemUgPSBzaXplb2YoZ3JuKSAvIHNpemVvZihncm5bMF0pOwogICAgc2l6ZV90IG5vbV9zaXplID0gc2l6ZW9mKG5vbSkgLyBzaXplb2Yobm9tWzBdKTsKICAgIGZvciggc2l6ZV90IGkgPSAwOyBpIDwgZ3JuX3NpemU7IGkrKyApCiAgICB7CiAgICAJc2l6ZV90IGRpZiA9IGdybltpXSoxMDA7CiAgICAJc2l6ZV90IGNudCA9IDA7CiAgICAJY291dDw8Z3JuW2ldPDwiIDogIjw8ZW5kbDsKICAgIAlmb3IoIHNpemVfdCBqID0gMDsgZGlmICYmIChqIDwgbm9tX3NpemUpOyBqKyspCiAgICAJewogICAgCQljbnQgPSBkaWYgLyBub21bal07CiAgICAJCWNvdXQ8PG5vbVtqXTw8IiA9ICI8PGNudDw8ZW5kbDsKICAgIAkJZGlmIC09IGNudCpub21bal07IAogICAgCX0KICAgIH0KICAgIHJldHVybiAwOwp9