-->
当前位置:首页 > 题库

PROGRAMMING:Define the base class point and derived class circle, find the circumference of the circle

Luz5年前 (2021-05-10)题库379
Define the base class point (point) and derived class circle (circle), find the circumference of the circle. The point class has two private data members, float x, y; The circle class adds a private data member radius float R and a public function getcircumreference(); The main function has been given, please write the point and circle classes.
```
#include
#include
using namespace std;
//Please write your code
int main()
{
float x,y,r;
cin>>x>>y>>r;
Circle c(x,y,r);
cout<return 0;
}
```
###Input format:
Enter the center and radius of the circle, x, y, R separated by a space.
###Output format:
Output the circumference of the circle, 2 significant digits after the decimal point.
###Input example:
```in
1 2 3
```
###Output example:
The corresponding output is given here. For example:
```out
Point constructor called
Circle constructor called
eighteen point eight four
Circle destructor called
Point destructor called
```







answer:If there is no answer, please comment