?? rectangle.cpp
字號:
/*************************************************************************** * Copyright (C) 2003 by ita * * tnagy@eleve.emn.fr * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * ***************************************************************************/#include "rectangle.h"rectangle::rectangle(int lo, int la, int xpos, int ypos,bool orient,int num){ longueur = lo; largeur = la; posx = xpos; posy = ypos; orientation = orient; numero = num;};rectangle::rectangle(){ longueur = 0; largeur = 0; posx = 0; posy = 0; orientation = 0; numero = 0;};rectangle::~rectangle(){}; intrectangle::getLongueur(){ if (orientation) return longueur; return largeur;}; intrectangle::getLargeur(){ if (orientation) return largeur; return longueur;}; intrectangle::getYHaut(){ return (posy + getLongueur()); }; intrectangle::getXMax(){ return (posx + getLargeur());}; intrectangle::getSurface(){ return (getLargeur() * getLongueur());};lieu::lieu(){ posx=0; posy=0;}lieu::lieu(int i, int j){ posx=i; posy=j;}bool operator< (rectangle x, rectangle y){ // attention, relation d'ordre oppos閑 (=>tri inverse) return (x.getSurface() > y.getSurface());}bool operator< (lieu x, lieu y){ if ((x.posy < y.posy) ) //or (x.posy == y.posy and x.posx <y.posx)) return 1; return 0;}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -