fork download
  1. #include <cstdlib>
  2. #include <iostream>
  3. #include <conio.h>
  4.  
  5. using namespace std;
  6.  
  7. class Obywatel {
  8. public:
  9. int nr_pesel;
  10. int wzrost;
  11. void pracuje();
  12. void odpoczywa();
  13. };
  14.  
  15. void Obywatel::pracuje(void){cout<<"Ide do pracy!\n";}
  16. void Obywatel::odpoczywa(void){cout<<"Pora na drzemke!\n";}
  17.  
  18. class Obywatel:public Student{
  19. public:
  20. int nr_indeksu;
  21. void studiuje();
  22. };
  23.  
  24. void Student::studiuje(void){cout<<"Czytam podreczniki.\n";}
  25.  
  26. int main(void)
  27. {
  28. Student Andrzej;
  29. Andrzej.nr_pesel = 99120200909;
  30. Andrzej.wzrost = 190;
  31. Andrzej.nr_indeksu = 221133;
  32. cout<<"\nMoj PESEL to: "<< Andrzej.nr_pesel <<"\nWzrostu mam:\n"<<Andrzej.wzrost<<"\nNr indeksu moj to: \n"<<Andrzej.nr_indeksu;
  33. Student.pracuje();
  34. Student.odpoczywa();
  35. Student.studiuje();
  36.  
  37.  
  38. getche();
  39. return(0);
  40. }
  41.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:3:19: fatal error: conio.h: No such file or directory
compilation terminated.
stdout
Standard output is empty