fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. const double meters2feet = 3.28;
  6. double mLength = 105.0;
  7. double mWidth = 68.0;
  8. double feetL;
  9. double feetW;
  10. double circumference;
  11. double ballRadius = 11.0;
  12. const double piVal = 3.14;
  13. int players;
  14. double gameTime;
  15.  
  16.  
  17. //convert stadium dimensions
  18. feetL = mLength * meters2feet;
  19. feetW = mWidth * meters2feet;
  20.  
  21. //calculate circumference
  22. circumference = (4/3) * piVal * ballRadius * ballRadius * ballRadius;
  23.  
  24. cout << "A size 5 ball has a circumference of " <<
  25.  
  26. //Input players
  27. cin >> players;
  28.  
  29. //Calculate time for players
  30. gameTime = players/90;
  31.  
  32. //Output time for players
  33. cout << "Each player gets " << gameTime << " minutes in the game." << endl;
  34.  
  35.  
  36. return 0;
  37. }
Success #stdin #stdout 0s 4392KB
stdin
9
stdout
Each player gets 0 minutes in the game.