Created
December 9, 2014 10:49
-
-
Save BraynStorm/d8614a8dfb3576636d49 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cstdlib> | |
using namespace std; | |
class Rectangle{ | |
public: | |
double x,y; | |
double getArea(){ | |
return x * y; | |
} | |
Rectangle (){ | |
cout << "Vuvedi X, Y:"; | |
cin >> x; | |
cin >> y; | |
} | |
Rectangle (double x, double y){ | |
this->x = x; | |
this->y = y; | |
} | |
}; | |
int main(){ | |
Rectangle* r = new Rectangle(); | |
cout << "Lice: " << r->getArea(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment