Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. Plot
  2.  
  3. In a forest, there were 'x' bunnies, 50% male, and 50% female, all adults. Bunnies doubles every 15 days, 10% of the baby rabbits dies at birth. They mature after 30 days, 30% leave the forest, and rest becomes rabbits. In every 30 days , 25% dies off due to flu. If every bunny dies off, the bunny world ends.
  4.  
  5.  
  6.  
  7. Task
  8.  
  9. Calculate the final number of bunnies alive after 1 year for any number of initial bunnies, x.
  10.  
  11.  
  12.  
  13. Input
  14.  
  15. Will be an integer number, the number of initial bunnies. Your program should read from the standard input
  16.  
  17.  
  18.  
  19. Output
  20.  
  21. Your program should write back to the standard output. When all bunnies die off, write 0 to the standard output.
  22.  
  23.  
  24.  
  25. Please note that percentages are truncated
  26.  
  27.  
  28.  
  29.  
  30.  
  31. Example
  32.  
  33. Test Case 1
  34.  
  35. 444 (input)
  36.  
  37. 0 (output)
  38.  
  39.  
  40.  
  41. Test Case 2
  42.  
  43. 30000 (input)
  44.  
  45. 56854 (output)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement