편집 기록

편집 기록
  • 프로필 알 수 없는 사용자님의 편집
    날짜2019.11.11

    main()에서 Rectangle r;이라는 코드가 실행할 수 있도록 Rectangle 클래스에 코드를 추가하는 것인데 무엇을 하는게 좋을까요 ?


    class Point{
    public:
        int x, y;
        Point(){}
        Point(int xx, int yy) { x = xx; y = yy; }
    };
    class Rectangle{
        Point p;
        int width, height;
    public:
         Rectangle(int x, int y, int w, int h) {
            p.x = x; p.y = y; width = w; height = h;
        }
    };
    
    
  • 프로필 nowp님의 편집
    날짜2019.11.11

    main()에서 Rectangle r;이라는 코드가 실행할 수 있도록 Rectangle 클래스에 코드를 추가하는 것인데 무엇을 하는게 좋을까요 ?


    class Point{
    
    public:
    
        int x, y;
        Point(){}
        Point(int xx, int yy) { x = xx; y = yy; }
    };
    
    class Rectangle{
    
        Point p;
        int width, height;
    public:
    
        Rectangle(int x, int y, int w, int h, ) {
            p.x = x; p.y = y; width = w; height = h;
        }
    };
    
    
  • 프로필 알 수 없는 사용자님의 편집
    날짜2019.11.11

    main()에서 Rectangle r;이라는 코드가 실행할 수 있도록 Rectangle 클래스에 코드를 추가하는 것인데 무엇을 하는게 좋을까요 ?


    class Point{

    public:

    int x, y;
    Point(){}
    Point(int xx, int yy) { x = xx; y = yy; }
    

    };

    class Rectangle{

    Point p;
    int width, height;
    

    public:

    Rectangle(int x, int y, int w, int h, ) {
        p.x = x; p.y = y; width = w; height = h;
    }
    

    };