作者在 2009-05-09 12:43:59 发布以下内容
#include<iostream>
#include<iomanip>
using namespace std;
class account
{private:
string _name;
long _balance;
public:
void credit(long amount);
void debit(long amount);
void setname(string name);
getbalance();
};
#include<iomanip>
using namespace std;
class account
{private:
string _name;
long _balance;
public:
void credit(long amount);
void debit(long amount);
void setname(string name);
getbalance();
};
void account::setname (string name)
{_name=name;
_balance=0;
}
{_name=name;
_balance=0;
}
void account::credit (long amount)
{_balance+=amount;
cout<<_name<<"存入$"<<amount<<"最新余额为"<<_balance;
}
{_balance+=amount;
cout<<_name<<"存入$"<<amount<<"最新余额为"<<_balance;
}
void account::debit(long amount)
{_balance-=amount;
cout<<_name<<"取出$"<<amount<<"最新余额为"<_balance;
}
{_balance-=amount;
cout<<_name<<"取出$"<<amount<<"最新余额为"<_balance;
}
account::getbalance()
{return _balance;
}
int main()
{account bluejoe;
bluejoe.setname ("白桥");
bluejoe.credit (10000000);
bluejoe.debit (10000);
return 0;
}
用vc++6.0 怎么好多错