fork download
  1. #include <cstdio>
  2. using namespace std;
  3.  
  4. class A
  5. {
  6. public:
  7. A(char a=0, int b=0, double c=0.0): a(a), b(b), c(c) { ; }
  8.  
  9. char getA() const { return a; }
  10. int getB() const { return b; }
  11. double getC() const { return c; }
  12.  
  13. void setA(char a) { this->a = a; }
  14. void setB(int b) { this->b = b; }
  15. void setC(double c) { this->c = c; }
  16.  
  17. private:
  18. char a;
  19. int b;
  20. double c;
  21. };
  22.  
  23. int main()
  24. {
  25. A a;
  26. a.setA(122);
  27. a.setB(122);
  28. a.setC(122);
  29. printf("%c\t%d\t%f\n", a.getA(), a.getB(), a.getC());
  30. return 0;
  31. }
Success #stdin #stdout 0s 2896KB
stdin
Standard input is empty
stdout
z	122	122.000000