Advertisement
BunchiePC

Ksiazki (klasy)

Apr 24th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.45 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. class ksiazki
  6. {
  7.     int ilosc_ksiazek;
  8. public:
  9.     void wypozyczenie(int a);
  10. };
  11. void ksiazki::wypozyczenie(int a)
  12. {
  13.     if(a>3) cout<<"Nie mozesz wypozyczyc wiecej ksiazek."<<endl;
  14.     else cout<<"Mozesz jeszcze wypozyczyc ksiazki."<<endl;
  15. }
  16.  
  17.  
  18.  
  19. int main()
  20. {
  21.     int x;
  22.     cout<<"Ilosc wypozyczonych ksiazek: "<<endl;
  23.     cin>>x;
  24.     ksiazki nowy;
  25.     nowy.wypozyczenie(x);
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement