fork download
  1. #include <iostream>
  2.  
  3. class testa {
  4. public:
  5. int n;
  6. double s;
  7.  
  8. void funca();
  9. };
  10. void testa::funca() {
  11. n = 500;
  12. s = 1.0/n;
  13. std::cout << s << std::endl;
  14. }
  15.  
  16. int main()
  17. {
  18. testa x;
  19. x.funca();
  20. }
  21.  
Success #stdin #stdout 0s 2896KB
stdin
Standard input is empty
stdout
0.002