Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream.h>
- #include <conio.h>
- #include <stdio.h>
- #include <stdlib.h>
- class goods
- {
- public:
- void setgoods(int n, int d, int c, int s)
- {name = n; dat = d; cena = c; sr = s;}
- void setgoods(const goods &t);
- void Display() const;
- int name, dat, cena, sr;
- };
- void goods::setgoods(const goods &t)
- {
- name = t.name;
- dat = t.dat;
- cena = t.cena;
- sr = t.sr;
- }
- void goods::Display() const
- {
- cout <<"Name -"<<name<<" data "<<dat<<" - "<<cena<<" "<<sr;
- }
- class date
- {
- public:
- void settime(int g, int m, int d)
- {god = g; mes = m; day = d;}
- void settime(const date &t);
- void Display() const;
- int god, mes, day;
- };
- void date::settime(const date &t)
- {
- god = t.god;
- mes = t.mes;
- day = t.day;
- }
- void date::Display() const
- {
- cout <<"Data -"<<god<<"."<<mes<<"."<<day;
- }
- int main()
- {
- clrscr();
- date t;
- int g,m,d,zn;
- printf("Vvedite God - ");scanf("%d",&g);
- printf("Vvedite mesayc - ");scanf("%d",&m);
- printf("Vvedite cuslo - ");scanf("%d",&d);
- cout<<"\n";
- t.settime(g,m,d);
- t.Display();
- cout<<"\n";
- getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement