Get the App
SLTechnology News&Howtos  ›  Development  › 

How to solve the problem of Monkey eating Peach by java

Shulou Source: shulou.com Published: 2022-06-01 07:42:20 10月03日 Update

This article mainly introduces "java how to solve the problem of monkeys eating peaches". In daily operation, I believe many people have doubts about how java solves the problem of monkeys eating peaches. Xiaobian consulted all kinds of materials and sorted out simple and easy operation methods. I hope to help you answer the doubts of "java how to solve the problem of monkeys eating peaches"! Next, please follow the small series to learn together!

Title Description:

On the first day, Wukong picked a number of peaches and immediately ate half of them. If he was not satisfied, he ate one more. On the second day, he ate more than half of the remaining peaches. After that, he ate more than half of the remaining peaches from the previous day every day. When he was ready to eat on the nth day, there was only one peach left. Clever you, please help Wukong calculate, how many peaches did he have when he started eating on the first day?

Recommended related video tutorial: java online tutorial

Input:

Enter a number n (1

Tags: Questions peaches monkeys learning input output number tutorials time more Wukong help practical smart fun next code online tutorials articles methods Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux MySQL Xiaomi Shulou Tech Info Microsoft