fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class A {
  5. public:
  6. float v;
  7. A() : v(1.0) {}
  8. A(A &a) : v(2.0) {}
  9. A(float f) : v(3.0) {}
  10. float get() {
  11. return A::v;
  12. }
  13. };
  14.  
  15. int main() {
  16. A a, b(a.get()), c(b);
  17. cout << a.v + b.v + c.v;
  18. return 0;
  19. }
  20.  
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
6