#include
class CBank
{
public:
CBank(float m_Amount)
{
balance=m_Amount;
}
float ChinaBank()
{
return balance;
}
friend void total();
private:
float balance;
};
class BBank
{
public:
BBank(float m_aMount)
{
balance=m_aMount;
}
float TradeBank()
{
return balance;
}
friend void total();
private:
float balance;
};
class GBank
{
private:
GBank(float m_amounT)
{
balance=m_amounT;
}
float AgricutureBank()
{
return balance;
}
friend void total();
private:
float balance;
};
void total()
{ float A,B,C;
cout<<"请输入您在中国银行的存款额:";
cin>>A;
cout<<"请输入您在工商银行的存款额:";
cin>>B;
cout<<"请输入您在农业行的存款额:";
cin>>C;
CBank China(A);
BBank Trade(B);
GBank Agricuture(C);
float a,b,c;
a=China.ChinaBank();
b=Trade.TradeBank();
c=Agricuture.AgricutureBank();
cout<<"您在三个银行的总存款额为:"<}
void main()
{
total(); 为了回答这问题害我又注册一空间!昨天的回答有一错
} 误, 现 在改了
请参考
//3、
#include
void main()
{
int s[10];
int i,j,m,a;
printf(
已发送,望楼主查收
希望采纳