#include <iostream> using std::cout; using std::cin; using std::endl; int main() { int startHeight = 100; //стартовая высота int growth = 50; //рост бамбука в день int losses = 20; //съедение бамбука int currentHeight = startHeight; int bambooHeight = 300; int day = (bambooHeight - startHeight) / (growth - losses); cout << "Высота бамбука будет составлять 3 метра на " << day * 3 << " день " << endl; }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter