fork download
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. class Ttekst{
  7. private:
  8. string _t;
  9. public:
  10. void wpisz(string t){_t=t;}
  11. string pobierz(){return _t;}
  12. Ttekst() {_t="nic";}
  13. ~Ttekst(){}
  14. };
  15.  
  16.  
  17. int main()
  18. {
  19. Ttekst O1, O2;
  20. string txt;
  21. cin>>txt;
  22. O1.wpisz(txt);
  23. O2.wpisz(O2.pobierz()+O1.pobierz());
  24. cout<<O2.pobierz()<<endl;
  25. cin.get();
  26.  
  27. return 0;
  28. }
Success #stdin #stdout 0s 3432KB
stdin
asdfas
as
stdout
nicasdfas