#include
#include
using namespace std;
class worker
{
public:
worker(int n,string nam ,float w):num(n),name(nam),wage(w){}
void display()
{
cout<<"num:"<
private:
int num;
string name;
float wage;
};
int main ()
{
worker a[5]={
worker(1,"zhangsan",750),
worker(2,"lisi",850),
worker(3,"wangba",650),
worker(4,"zhaoliu",900),
worker(5,"wangqi",1000)
};
cout<<"the information of five workers:"<
{a[i].display();
cout<
}
联系我,我发给你!
CAI