• <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 閱讀(5147) 評論(0)  編輯 收藏 引用
            国产一区二区精品久久岳| 久久久久久极精品久久久| 亚洲色婷婷综合久久| 久久久一本精品99久久精品88 | 国产精品欧美久久久久天天影视| 久久国产美女免费观看精品 | 亚洲精品国产美女久久久| 国产高潮久久免费观看| 亚洲日本va中文字幕久久| 久久996热精品xxxx| 久久99国内精品自在现线| 思思久久99热只有频精品66| 国产精品一久久香蕉国产线看| 久久精品国产99久久香蕉| 久久99精品久久久久久动态图| 久久久无码精品亚洲日韩软件| 国产成人精品久久免费动漫| 久久久久99这里有精品10| 99热精品久久只有精品| 久久综合给合久久狠狠狠97色| 无码国内精品久久人妻麻豆按摩| 欧美精品一本久久男人的天堂 | 伊人久久综合热线大杳蕉下载| 伊人久久精品无码二区麻豆| 久久99这里只有精品国产| 久久久WWW成人免费精品| 欧美精品一区二区精品久久| 国产精品视频久久久| 91精品国产乱码久久久久久| 婷婷五月深深久久精品| 亚洲级αV无码毛片久久精品| 欧美精品九九99久久在观看| 中文字幕精品久久| 狠狠色丁香久久婷婷综合蜜芽五月| 久久综合九色欧美综合狠狠| 久久精品国产亚洲av瑜伽| 欧美一级久久久久久久大片| 色综合久久天天综线观看| 精品久久久一二三区| 无码人妻久久一区二区三区免费 | 久久久久国产精品嫩草影院|