#include<iostream>
using namespace std;
class CE
{
private:
int a,b;
int getmin()
{
return (a<b? a:b);//判断a,b大小,输出最小值
}
public:
int c;
void SetValue(int x1,int x2, int x3)//a,b,c赋值
{
a=x1;
b=x2;
c=x3;
}
int GetMin();
};
int CE::GetMin()
{
int d=getmin();
return (d<c? d:c);//判断d,c大小,输出最小值
}
int main()
{
int x=5,y=12,z=8;
CE *ep;
ep=new CE;
ep->SetValue(x+y,y-z,10);//a=17,b=4,c=10
cout<<ep->GetMin()<<endl;//判断a,c,b大小,输出最小值为4
CE a=*ep;
cout<<a.GetMin()*3+15<<endl;//输出27
return 0;
}
//所以输出4 27
运算结果: