/* * ===================================================================================== * * Filename: rectangles.c * * Description: Rectangles * * Version: 1.0 * Created: 11/30/2011 01:41:19 PM * Revision: none * Compiler: gcc * * Author: Milan Kabat (), kabat@ics.muni.cz * Company: FI MUNI * * ===================================================================================== */ #include #include struct point { double x; double y; }; struct rectangle { struct point lb; struct point rt; }; struct point createPoint(double x, double y) { struct point p; p.x = x; p.y = y; return p; } struct rectangle createRectangle(double x1, double y1, double x2, double y2) { struct rectangle r; r.lb = createPoint(x1, y1); r.rt = createPoint(x2, y2); return r; } int isSquare(struct rectangle *rect) { //Doplnte } void printRectangle(struct rectangle *rect) { //Doplnte } int overlap(struct rectangle *rect1, struct rectangle *rect2) { //Doplnte } /* * === FUNCTION ====================================================================== * Name: main * Description: * ===================================================================================== */ int main ( int argc, char *argv[] ) { printf("\n"); struct rectangle rect1, rect2; double x1, y1, x2, y2; //Doplnte nacitanie premennych x1, y1, x2, y2 pre prvy obdlznik rect1 = createRectangle(x1, y1, x2, y2); //Doplnte nacitanie premennych x1, y1, x2, y2 pre druhy obdlznik rect2 = createRectangle(x1, y1, x2, y2); //Vypiste prvy obdlznik a zistite, ci sa jedna o stvorec //Vypiste druhy obdlznik a zistite, ci sa jedna o stvorec //Zistite, ci sa obdlzniky prekryvaju return EXIT_SUCCESS; } /* ---------- end of function main ---------- */