Advertisement
poor_fool_mloody

zaliczenie

Jan 16th, 2018
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. // Gówno.cpp : Defines the entry point for the console application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include <iostream>
  6. using namespace std;
  7.  
  8. class Data
  9. {
  10. public:
  11. Data();
  12. ~Data();
  13. friend istream & operator>> (istream & we, Data & klasa)
  14. {
  15. cout << "Podaj dzien: ";
  16. we >> klasa.dzien;
  17. cout << "Podaj miesiac: ";
  18. we >> klasa.miesiac;
  19. return we;
  20. }
  21. void Wyswietl()
  22. {
  23. cout << this->dzien << '.' << this->miesiac << '.' << this->rok;
  24. }
  25.  
  26. private:
  27. int dzien;
  28. int miesiac;
  29. const int rok;
  30. };
  31.  
  32. Data::Data()
  33. : rok(2000)
  34. , dzien(1)
  35. , miesiac(1)
  36. {
  37. }
  38.  
  39. Data::~Data()
  40. {
  41. }
  42.  
  43. int main()
  44. {
  45. Data dupa;
  46. cin >> dupa;
  47. dupa.Wyswietl();
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement