Advertisement
Guest User

Untitled

a guest
Jul 3rd, 2013
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.06 KB | None | 0 0
  1. #include <iostream.h>
  2. #include <conio.h>
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5. class goods
  6. {
  7. public:
  8. void setgoods(int n, int d, int c, int s)
  9. {name = n; dat = d; cena = c; sr = s;}
  10. void setgoods(const goods &t);
  11. void Display() const;
  12. int name, dat, cena, sr;
  13. };
  14.  
  15. void goods::setgoods(const goods &t)
  16. {
  17. name = t.name;
  18. dat = t.dat;
  19. cena = t.cena;
  20. sr = t.sr;
  21. }
  22.  
  23. void goods::Display() const
  24. {
  25. cout <<"Name -"<<name<<" data "<<dat<<" - "<<cena<<" "<<sr;
  26. }
  27.  
  28. class date
  29. {
  30. public:
  31. void settime(int g, int m, int d)
  32. {god = g; mes = m; day = d;}
  33. void settime(const date &t);
  34. void Display() const;
  35. int god, mes, day;
  36. };
  37.  
  38. void date::settime(const date &t)
  39. {
  40. god = t.god;
  41. mes = t.mes;
  42. day = t.day;
  43. }
  44.  
  45. void date::Display() const
  46. {
  47. cout <<"Data -"<<god<<"."<<mes<<"."<<day;
  48. }
  49.  
  50.  
  51. int main()
  52. {
  53. clrscr();
  54. date t;
  55. int g,m,d,zn;
  56. printf("Vvedite God - ");scanf("%d",&g);
  57. printf("Vvedite mesayc - ");scanf("%d",&m);
  58. printf("Vvedite cuslo - ");scanf("%d",&d);
  59. cout<<"\n";
  60. t.settime(g,m,d);
  61.  
  62. t.Display();
  63. cout<<"\n";
  64.  
  65. getch();
  66.  
  67. return 0;
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement