Skip to content

Instantly share code, notes, and snippets.

@BraynStorm
Created December 9, 2014 10:49
Show Gist options
  • Save BraynStorm/d8614a8dfb3576636d49 to your computer and use it in GitHub Desktop.
Save BraynStorm/d8614a8dfb3576636d49 to your computer and use it in GitHub Desktop.
#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