Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class Codrea{
- private:
- int cnp;
- int nr_ci;
- public:
- Codrea(int cnp, int nr_ci){
- this->cnp = cnp;
- this->nr_ci = nr_ci;
- }
- Codrea(){
- this->cnp = 41454321;
- this->nr_ci = 12;
- }
- int getCNP(){ return cnp; };
- int getNR_CI(){ return nr_ci; };
- };
- class Andreea : public Codrea{
- private:
- string culoare_ochi;
- public:
- Andreea() : Codrea(){
- this->culoare_ochi = "albastru";
- }
- Andreea(string culoare_ochi, int cnp, int nr_ci) : Codrea(cnp, nr_ci){
- this->culoare_ochi = culoare_ochi;
- }
- };
- void main(){
- Andreea a("verde",104112, 15);
- cout << a.getCNP() << endl;
- cout << a.getNR_CI() << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement