#include <iostream>
#include <cmath>
using namespace std;
class CPU
{
float voltage;
public:
CPU(){
}
CPU( float v=1.35)
{
voltage=v;
}
};
class Computer
{
CPU cpu;
public:
Computer(){
}
};
int main()
{
return 0;
}
CPU类的构造函数重复了,可以去掉默认参数解决,将13行的CPU( float v=1.35)
改为CPU( float v)