当前位置:网站首页>Notes on writing questions in C language -- monkeys eat peaches
Notes on writing questions in C language -- monkeys eat peaches
2022-06-25 09:38:00 【Fanyi】

List of articles
subject
A ball from 100 Free fall at meter height , Jump back to half of the original height after landing ; And then fall , Ask it in the 10 The next landing , How many meters in total ? The first 10 How high is the rebound ?
Ideas
Adopt the method of converse thinking , Infer from back to front with loop statements .
Answer key
#include <stdio.h>
int main()
{
int day,x1,x2;
day=9;
x2=1;
while(day>0)
{
x1=(x2+1)*2; // The number of peaches on the first day was 2 The number of peaches in the sky 1 After 2 times
x2=x1;
day--;
}
printf(" On the first day, I picked %d A peach .\n",x1);
}
Sample output


边栏推荐
- PMP考试多少分算通过?
- Solution to the problem of repeated startup of esp8266
- Make a skylearn high-dimensional dataset_ Circles and make_ moons
- neo4jDesktop(neo4j桌面版)配置自动启动(开机自启)
- Is it safe to open an account in a mobile phone or a securities company?
- x86电脑上下载debian的arm64的包
- Explanation of assertions in JMeter
- Opencv中的GrabCut图像分割
- A game WP
- Japanese online notes for postgraduate entrance examination (9): composition template
猜你喜欢

3 big questions! Redis cache exceptions and handling scheme summary

行业春寒回暖,持续承压的酒店企业于何处破局?

Where are the hotel enterprises that have been under pressure since the industry has warmed up in spring?

浅谈Mysql底层索引原理
![[IOU] intersection over union](/img/17/a3e2144dfbd9248034cae285ee85bd.jpg)
[IOU] intersection over union

matplotlib matplotlib中axvline()和axhline()函数

Matplotlib plt grid()

可穿戴设备或将会泄露个人隐私

3大问题!Redis缓存异常及处理方案总结

Analysis on the bottom calling process of micro service calling component ribbon
随机推荐
[zero foundation understanding innovation and entrepreneurship competition] overall cognition and introduction of mass entrepreneurship and innovation competition (including FAQs and integration of bl
Benefits and types of cloud network technology
在指南针上面开股票账户好不好,安不安全?
[shared farm] smart agriculture applet, customized development and secondary development of Kaiyuan source code, which is more appropriate?
How much money have I made by sticking to fixed investment for 3 years?
华泰证券在上面开户安全吗?靠谱吗?
C语言刷题随记 —— 猴子吃桃
Mapping mode of cache
[wechat applet full stack development course] course directory (mpvue+koa2+mysql)
Etcd教程 — 第四章 Etcd集群安全配置
SQL advanced
高速缓冲存储器Cache的映射方式
Opencv中的GrabCut图像分割
Is it safe to open an account on the compass?
[final review notes] digital logic
Study on correlation of pumpkin price and design of price prediction model based on BP neural network
Analysis on the bottom calling process of micro service calling component ribbon
neo4jDesktop(neo4j桌面版)配置自动启动(开机自启)
2021mathorcupc topic optimal design of heat dissipation for submarine data center
[competition -kab micro entrepreneurship competition] KAB National College Students' micro entrepreneurship action participation experience sharing (including the idea of writing the application form)