#include <iostream>
using namespace std;
struct Value
{
int hundred;
int fifty;
int ten;
int five;
int one;
Value(int h,int f,int t,int fi,int o)
{
hundred=h;
fifty=f;
ten=t;
five=fi;
one=o;
}
Value()
{
hundred=0;
fifty=0;
ten=0;
five=0;
one=0;
}
};
struct staff
{
string name;
int wages;
staff(string n,int w)
{
name=n;
wages=w;
}
};
int Result(staff *staffs,int count)
{
Value *Values=new Value[count];
for(int i=0;i<count;i++)
{
int w=staffs[i].wages;
int h,f,t,fi,o;
h=w/100;
f=(w-h*100)/50;
t=(w-h*100-f*50)/10;
fi=(w-h*100-f*50-t*10)/5;
o=(w-h*100-f*50-t*10-fi*5)/1;
Values[i].hundred=h;
Values[i].fifty=f;
Values[i].ten=t;
Values[i].five=fi;
Values[i].one=o;
}
for(int i=0;i<count;i++)
{
cout<<"员工:"<<staffs[i].name<<" 工资为:"<<staffs[i].wages<<endl;
cout<<"应发:100元:"<<Values[i].hundred<<" 50元:"<<Values[i].fifty<< " 10元:"<<Values[i].ten<<" 5元:"<<Values[i].five<<" 1元:"<<Values[i].one<<endl;
cout<<"----------------------------------------------"<<endl;
}
}
int main()
{
staff staffs[]={
staff("王红",2135),
staff("李言",1862),
staff("赵林",2639),
staff("张军",2581)
};
int count = sizeof(staffs)/sizeof(staff);
Result(staffs,count);
}