Problem2226--C++ Programming Sit: Circle

2226: C++ Programming Sit: Circle

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 617  Solved: 34
[Submit] [Status] [Web Board] [Creator:]

Description

Design a C++ class Circle with three members, x, y, and radius where (x, y) is the location of the circle center. The Circle class includes a constructor that takes 3 double values for x, y, and radius. The class Circle includes an overloaded << operator, which outputs all the member variables. The class has a member function, int overlap(Circle secondCircle), that returns 1 if the secondCircle and the calling object (the first circle) overlap (the distance between the two centers the sum of the two radiuses). Write a main function that creates two circles using the double values for their members entered by user, and prints 1 if the two circles overlap, or 0 otherwise. The main function outputs the first circle using the overloaded << operator.

Input

The x, y, and radius value of the first circle The x, y, and radius value of the second circle

Output

1 if two circles overlap or 0 otherwise The x, y, and radius value of the first circle

Sample Input Copy

0 0 1
-1 -1 1

Sample Output Copy

1
0 0 1

Source/Category

266