fork(1) download
  1. #include <stdio.h>
  2. #include <iostream>
  3. #include <string>
  4.  
  5. using namespace std;
  6.  
  7. class DuzaLiczba
  8. {
  9. string wartosc;
  10. static string dodawanie(const string& s1, const string& s2);
  11. public:
  12. DuzaLiczba(string value):wartosc(value) { }
  13. DuzaLiczba operator+(const DuzaLiczba&) const;
  14.  
  15. friend ostream& operator<<(ostream& out, const DuzaLiczba& liczba)
  16. { out << liczba.wartosc << endl; return out;}
  17. };
  18.  
  19.  
  20. string DuzaLiczba::dodawanie(const string& s1, const string& s2)
  21. {
  22. return "WYNIK";
  23. }
  24.  
  25.  
  26. DuzaLiczba DuzaLiczba::operator+(const DuzaLiczba& n) const
  27. {
  28. return DuzaLiczba( dodawanie(wartosc,n.wartosc) );
  29. }
  30.  
  31.  
  32. int main()
  33. {
  34. DuzaLiczba liczba1("123");
  35. DuzaLiczba liczba2("123");
  36.  
  37. cout << liczba1+liczba2;
  38. system("pause");
  39. return 0;
  40. }
Success #stdin #stdout #stderr 0s 3428KB
stdin
Standard input is empty
stdout
WYNIK
stderr
sh: pause: not found