fork download
  1. #include <iostream>
  2. #include <cstdlib>
  3.  
  4. using namespace std;
  5.  
  6. class GetRandomInt{
  7. int random_int;
  8. int min;
  9. int max;
  10. public:
  11. GetRandomInt();
  12. int RandomInt();
  13.  
  14. };
  15. GetRandomInt::GetRandomInt(){
  16. random_int=rand() % 100+1;
  17. }
  18.  
  19. int GetRandomInt::RandomInt(){
  20. return random_int;
  21. }
  22.  
  23. int main()
  24. {
  25. GetRandomInt lol;
  26. cout<<lol.RandomInt()<<endl;
  27. return 0;
  28. }
  29.  
Success #stdin #stdout 0.01s 2680KB
stdin
Standard input is empty
stdout
84