#include <iostream>
using namespace std;
class A
{
friend double count(A&);
public:
A(double t, double r):total(t),rate(r){}
private:
double total;
double rate;
};
double count(A&a)
{
a.total+=a.rate*a.total;
return a.total;
}
int main(void )
{
A x(100,0.5),y(50,0.1);
cout<<count(x)<<" "<<count(y)<<endl;
cout<<count(x) <<"\n";
return 0;
}
这段代码是什么意思??