# include <iostream>
using namespace std;
class Cube
{
private :
int m_a;
int m_b;
int m_c;
int m_v;
int m_s;
public :
public :
void setABC ( int a = 0 , int b = 0 , int c = 0 )
{
m_a = a;
m_b = b;
m_c = c;
}
int getA ( )
{
return m_a;
}
int getB ( )
{
return m_b;
}
int getC ( )
{
return m_c;
}
int getV ( )
{
m_v = m_a * m_b * m_c;
return m_v;
}
int getS ( )
{
m_s = 2 * ( m_a * m_b) + ( m_a * m_c) + ( m_b * m_c) ;
return m_s;
}
int judge ( Cube& v2)
{
if ( ( m_a == v2. getA ( ) ) &&
( m_b == v2. getB ( ) ) &&
( m_c == v2. getC ( ) )
)
return 0 ;
}
} ;
int judge ( Cube& v1, Cube& v2)
{
if ( ( v1. getA ( ) == v2. getA ( ) ) &&
( v1. getB ( ) == v2. getB ( ) ) &&
( v1. getC ( ) == v2. getC ( ) ) )
{
return 1 ;
}
else
{
return 0 ;
}
}
int main ( )
{
Cube v1, v2;
v1. setABC ( 1 , 2 , 3 ) ;
cout<< v1. getS ( ) << endl;
cout<< v1. getV ( ) << endl;
v2. setABC ( 1 , 2 , 4 ) ;
int tag = v1. judge ( v2) ;
if ( tag == 1 )
{
cout << "=" << endl;
}
else
{
cout << "not equal" << endl;
}
}
# include <iostream>
using namespace std;
class Point ;
class Point
{
public :
void setPoint ( int _x1, int _y1)
{
x1 = _x1; y1 = _y1;
}
int getX1 ( )
{
return x1;
}
int getY1 ( )
{
return y1;
}
protected :
private :
int x1;
int y1;
} ;
class AdvCircle
{
public :
void setCircle ( int _r, int _x0, int _y0 )
{
r = _r; x0 = _x0; y0 = _y0;
}
public :
int judge ( Point& myp)
{
int d = ( myp. getX1 ( ) - x0) * ( myp. getX1 ( ) - x0) + ( myp. getY1 ( ) - y0) * ( myp. getY1 ( ) - y0) ;
if ( d <= r)
{
return 0 ;
}
else
{
return 1 ;
}
return 0 ;
}
protected :
private :
int r;
int x0;
int y0;
} ;
void main ( )
{
AdvCircle c1;
c1. setCircle ( 3 , 1 , 1 ) ;
Point p1;
p1. setPoint ( 2 , 4 ) ;
int tag= c1. judge ( p1) ;
if ( tag == 1 )
{
cout << "in the circle" << endl;
}
else {
cout << "not in the circle" << endl;
}
return ;
}