fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int x=2, y=x+30;
  5.  
  6. struct A{
  7. static int x;
  8. int y;
  9. public:
  10. operator int( ){ return x-y; }
  11. A operator ++(int){ return A(x++, y++); }
  12. A(int x=::x+2, int y=::y+3){ A::x=x; A::y=y; }
  13. int &h(int &x);
  14. };
  15. int &A::h(int &x)
  16. {
  17. for(int y=1; y!=1|| x<201; x+=11, y++) if(x>200) { x-=21; y-=2;}
  18. return x-=10;
  19. }
  20. int A::x=23;
  21. int main( ){
  22.  
  23. A a(54, 3), b(65), c;
  24. cout << a.x << " " << a.y << " " << b.x << " " << b.y << " " << c.x << " " << c.y;
  25. }
Success #stdin #stdout 0s 3412KB
stdin
Standard input is empty
stdout
4 3 4 35 4 35