#include <stdio.h>
#include
#include
#include <math.h>
float f(float x, float y, float z) {
float a = x * x + 9.0f / 4.0f * y * y + z * z - 1;
return a * a * a - x * x * z * z * z - 9.0f / 80.0f * y * y * z * z * z;
}
float h(float x, float z) {
for (float y = 1.0f; y >= 0.0f; y -= 0.001f)
if (f(x, y, z) <= 0.0f) {
return y;
}
return 0.0f;
}
class Base //父类
{
private:
int _priB;
protected:
int _proB;
Base(){
_priB =1;
_proB =2;
_pubB =3;
printf(“base \n”);
}
public:
int _pubB;
int aq;
virtual bool operator==(const Base& kk);
// virtual void funct()=0;
};
bool Base::operator==(const Base& kk){
printf(“operator df\n”);
return true;
}
class C :public Base //基类Base的派生类C(私有继承)
{
public:
int al;
C(int a){
_pubB = a;
// printf(“C start \n”);
}
void funct(){
printf(“C func\n”);
}
virtual bool operator==(const Base& kk){
printf(“C operator-------\n”);
}
};
// void C::funct()
// {
//
// }
int main() {
int a=1;
Base* c = new C(1000);
Base* m = new C(2000);
if(*(c)==*(m)){
printf("fdasf\n");
}
a=c->_pubB;
c->aq = 0;
// c->al = 0;
// c->funct();
printf("%d",a);
return 0;
}