Advertisement
dzieciol

zadanie 1b

Oct 20th, 2016
497
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6.  
  7. /*
  8. * File: main.cpp
  9. * Author: Tomek
  10. *
  11. * Created on 20 października 2016, 18:03
  12. */
  13.  
  14. #include <cstdlib>
  15. #include <iostream>
  16.  
  17. using namespace std;
  18.  
  19. class ulamek
  20. {
  21. int licznik, mianownik;
  22.  
  23. public:
  24. ulamek(int l = 1, int m = 1){
  25. licznik = l;
  26. mianownik = m;
  27. }
  28. wyswietl();
  29.  
  30. };
  31.  
  32. /*
  33. *
  34. */
  35. int main(int argc, char** argv) {
  36.  
  37. ulamek u1;
  38. ulamek u2(1,4);
  39. u2.wyswietl();
  40. u1.wyswietl();
  41.  
  42. return 0;
  43. }
  44.  
  45.  
  46.  
  47. ulamek::wyswietl()
  48. {
  49. cout<<licznik<<"/"<<mianownik<<endl;
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement