Guest User

Untitled

a guest
Jan 21st, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. // ConsoleApplication9.cpp: Definiuje punkt wejścia dla aplikacji konsolowej.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include <iostream>
  6. using namespace std;
  7. class ulamek {
  8. private:
  9. int licznik;
  10. int mianownik;
  11. public:
  12. ulamek::ulamek() : licznik(0) , mianownik(1)
  13. {
  14. }
  15. ulamek::ulamek(int a, int b) : licznik(a), mianownik(b)
  16. {}
  17. ulamek::~ulamek()
  18. {}
  19. void printuj()
  20. {
  21.  
  22. cout << endl << licznik << '/' << mianownik << endl;
  23. }
  24. };
  25.  
  26. int main()
  27. {
  28. ulamek b;
  29. ulamek a(3, 5);
  30. a.printuj();
  31. b.printuj();
  32. system("Pause");
  33. return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment