fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class stack{
  5. public:
  6. static int stored;
  7. };
  8. int stack::stored;
  9.  
  10. int main() {
  11. // your code goes here
  12. stack s, m, n;
  13. s.stored = 4;
  14. std::cout << s.stored << "," << m.stored << "," << n.stored << std::endl;
  15. m.stored = 5;
  16. std::cout << s.stored << "," << m.stored << "," << n.stored << std::endl;
  17. n.stored = 1;
  18. std::cout << s.stored << "," << m.stored << "," << n.stored << std::endl;
  19. return 0;
  20. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
4,4,4
5,5,5
1,1,1