Advertisement
Guest User

Untitled

a guest
Jan 26th, 2015
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. template<class S>
  5. class Liczba
  6. {
  7. S wartosc;
  8. public:
  9. void wczytaj();
  10. void wypisz();
  11. };
  12.  
  13. template<class S>
  14. void Liczba<S>::wczytaj()
  15. {
  16. cout<<"\tWprowadz liczbe: " ;
  17. cin>>wartosc;
  18. }
  19.  
  20. template <class S>
  21. void Liczba<S>::wypisz()
  22. {
  23. cout<<"\tWartosc ktora przechowuje program: "<<wartosc<<endl ;
  24. }
  25.  
  26. main()
  27. {
  28. Liczba <float>l1;
  29. l1.wczytaj();
  30. l1.wypisz();
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement