• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            #include <iostream>

            using namespace std;

            #include 
            "Point.hpp"

            Point::Point()
            {
            }

            Point::Point( 
            int a, int b ):
            x(a), y(b)
            {
            }

            void Point::SetX( int a )
            {
                x
            = a;
            }

            void Point::SetY( int a )
            {
                y
            = a;
            }

            void Point::SetXY( int a, int b )
            {
                x
            = a, y= b;
            }

            int Point::GetX() const
            {
                
            return x;
            }


            int Point::GetY() const
            {
                
            return y;
            }

            void Point::Print() const
            {
                cout 
            << "X 坐標為 " << x << endl;
                cout 
            << "y 坐標為 " << y << endl;
            }
            //下面這些包含在文件 Circle.cpp 中

            #include 
            <iostream>
            #include 
            <cmath>

            #include 
            "Circle.hpp"
            #include 
            "Point.hpp"

            using namespace std;

            Circle::Circle ()
            {
            }

            Circle::Circle( 
            int a )
            {
                radius
            = a;
            }

            Circle::Circle( 
            int a, int b, int c )
            {
                radius
            = a;

                centre.SetXY( b, c);
            }

            Circle::Circle( 
            int a, Point b )
            {
                radius
            = a;
                centre
            = b;
            }

            void Circle::SetCentre( int a, int b )
            {
                centre.SetXY( a, b );
            }

            void Circle::SetCentre( Point p )
            {
                centre
            = p;
            }

            void Circle::SetRadius( int a )
            {
                radius
            = a;
            }

            void Circle::Print() const
            {
                cout 
            << "半徑為 " << radius << endl;
                centre.Print();
            }

            int Circle::GetRadius() const
            {
                
            return radius;
            }

            Point Circle::GetCentre() 
            const
            {
                
            return centre;
            }

            void Circle::Relation ( Circle& t )
            {
                
            double dis= sqrt( (double)(t.GetCentre().GetX()- centre.GetX())* (t.GetCentre().GetX()- centre.GetX())+
                                  (t.GetCentre().GetY()
            - centre.GetY())* (t.GetCentre().GetY()- centre.GetY()) );

                
            double r1= radius+ t.GetRadius();
                
            double r2= abs( radius- t.GetRadius() );

                
            if( dis== r1 || r2== dis  ) cout<< "這兩個圓相切" << endl;
                
            else if( dis> r1 ) cout << "兩圓相離" << endl;
                
            else if( dis< r2 ) cout << "兩圓包含" << endl;
                
            else  cout << "兩圓相交" << endl;
            }






            #ifndef CIRCLE_HPP
            #define CIRCLE_HPP

            #include 
            "Point.hpp"

            class Circle
            {
            private:
                
            int   radius;
                Point centre;

            public:
                Circle();
                Circle( 
            int );
                Circle( 
            int, Point );
                Circle( 
            intintint );

                
            void SetRadius( int );
                
            void SetCentre( intint );
                
            void SetCentre( Point );

                
            int   GetRadius()      const;
                Point GetCentre()      
            const;

                
            void Print()          const;

                
            void   Relation( Circle& );
            };


            #endif



            #pragma once

            class Point
            {
            private:
                
            int x, y;

            public:
                Point();
                Point( 
            intint );

                
            void SetX( int );           //  設置 X 值
                void SetY( int );           //  設置 Y 值
                void SetXY( intint );     //  同時設置 X Y 值

                
            int  GetX()        const;   //   獲得 X 值
                int  GetY()        const;   //   獲得 Y 值

                
            void Print()       const;   //   打印點信息
            };



            #include <iostream>

            using namespace std;

            #include 
            "Circle.hpp"
            #include 
            "Point.hpp"

            int main()
            {
                Circle t1( 
            1, Point(3,4) ), t2( 4, Point(6,8) );
                t1.Print();
                t1.Relation(t2);

                t1.SetCentre( Point(
            4,4) );
                t1.Print();
                t1.Relation(t2);

                t1.SetRadius( 
            5 );
                t1.Print();
                t1.Relation(t2);

                cout 
            << t1.GetCentre ().GetX() << "  " << t1.GetCentre().GetY() << endl;
                cout 
            << t1.GetRadius ()   << endl;

                
            return 0;
            }
            posted on 2009-03-03 18:03 Darren 閱讀(5143) 評論(0)  編輯 收藏 引用
            亚洲精品97久久中文字幕无码| 久久99精品国产麻豆婷婷| 久久久国产视频| 人妻少妇精品久久| 99精品久久久久久久婷婷| 亚洲成色WWW久久网站| 久久精品亚洲精品国产色婷 | 91久久精品国产免费直播| 久久99精品久久久久久噜噜| 人妻丰满?V无码久久不卡| 国产午夜福利精品久久2021| 久久综合丝袜日本网| 欧美激情一区二区久久久| 精品久久久久久久久中文字幕| 欧美国产精品久久高清| 久久久免费精品re6| 欧美精品丝袜久久久中文字幕| 久久香蕉国产线看观看精品yw| 久久国产香蕉一区精品| 久久精品国产亚洲av水果派| 要久久爱在线免费观看| 国产一区二区精品久久岳| 久久亚洲精精品中文字幕| 综合久久给合久久狠狠狠97色 | 婷婷综合久久中文字幕| 久久久久久久久久久久久久| 国产福利电影一区二区三区久久老子无码午夜伦不 | 国产亚洲美女精品久久久| 精品无码久久久久国产| 99久久国产亚洲综合精品| 2019久久久高清456| 久久久久国产精品麻豆AR影院 | 亚洲伊人久久综合中文成人网| 伊人久久大香线蕉影院95| av国内精品久久久久影院 | 久久精品国产91久久麻豆自制| 丁香色欲久久久久久综合网| 香蕉久久AⅤ一区二区三区| 久久青青草原精品国产软件| 久久精品无码免费不卡| 无夜精品久久久久久|