其实c++不懂,刚开始看,有点稀里糊涂的,虽然不是计算机专业的,不过我觉得要自学,
所以顺便帮同学。最后没做出来,
请了我们班的高手,就做出来了,贴贴代码
/*
定义一个用户管理类,管理用户名和密码,输入用户名时输出其密码。
提示:定义Cuser类,含有name、pwd  2个数据成员,构造函数、Getname()、Getpwd() 3个成员函数。
定义一个对象数组并对其初始化,对象数组中的每个元素存储一个用户信息。
输入用户名后,在数组中查找,找到后输出其密码,找不到时输出错误信息。*/
注意:构造函数不能调用==!
#include<iostream>
#include<string>
using namespace std;
class Cuser
{
private:
    string name;
    int pwd;
public:
    Cuser()
    {}
    string Getname()
    {
        return name;
    }
    int Getpwd()
    {
        return pwd;
    }
    void Insetdata(string str,int p)
    {
        name=str;
        pwd=p;
    }
};
int main()
{
    string str;
    Cuser Cus[3];
    int i,f;
    
    Cus[0].Insetdata("liny",123);
    Cus[1].Insetdata("abd",12345);
    Cus[2].Insetdata("oweu",3232);
    while(cin>>str)
    {
        f=0;
        for(i=0;i<3;i++)
        {
            if(Cus[i].Getname()==str)
            {
                cout<<"密码是:"<<endl;
                cout<<Cus[i].Getpwd()<<endl;
                f=1;
            }
        }
        if(!f)
        {
            cout<<"没有信息"<<endl;
        }
    }
    return 0;
}