Share Pastebin
Guest
Public paste!

povrsina.cpp

By: a guest | Mar 16th, 2010 | Syntax: C++ | Size: 0.39 KB | Hits: 39 | Expires: Never
This paste has a previous version, view the difference. Copy text to clipboard
  1. class Pravokutnik {
  2.   private:
  3.   int x, y, w, h;
  4.  
  5.   public:
  6.   Pravokutnik (int _x, int _y, int _w, int _h) {
  7.     x=_x;
  8.     y=_y;
  9.     w=_w;
  10.     h=_h;
  11.   }
  12.  
  13.   int LijeviRub() {
  14.     return x;    
  15.   }
  16.  
  17.   int DonjiRub() {
  18.     return y;
  19.   }
  20.  
  21.   int Sirina() {
  22.     return w;
  23.    
  24.   }
  25.   int Visina() {
  26.     return h;  
  27.   }
  28.  
  29.   int Povrsina() {
  30.     return h*(w);  
  31.   }  
  32. };