当前位置:网站首页>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


边栏推荐
- 手机办理长城证券开户靠谱安全吗?
- 使用EVO
- Compile time annotations for custom annotations (retentionpolicy.class)
- Where is safe for FTSE A50 to open an account
- Opencv中的GrabCut图像分割
- 匯付國際為跨境電商賦能:做合規的跨境支付平臺!
- Flitter gets the height of the top status bar
- Is it safe to open an account in a mobile phone or a securities company?
- Matplotlib simple logistic regression visualization
- matplotlib matplotlib中plt.axis()用法
猜你喜欢

Mapping mode of cache
![[IOU] intersection over union](/img/17/a3e2144dfbd9248034cae285ee85bd.jpg)
[IOU] intersection over union

Data-driven anomaly detection and early warning of 21 May Day C

纳米数据世界杯数据接口,中超数据,体育数据比分,世界杯赛程api,足球比赛实时数据接口

Cubemx stm32f105rb USB flash drive reading and writing detailed tutorial

SQL advanced

《JVM》对象内存分配的TLAB机制与G1中的TLAB流程

neo4jDesktop(neo4j桌面版)配置自动启动(开机自启)

Use Navicat to compare data differences and structure differences of multi environment databases, and automatic DML and DDL scripts

Why should the terminal retail industry choose the member management system
随机推荐
Flitter gets the height of the top status bar
35 websites ICER must know
Is it safe to open an account online? Who can I ask?
Simple waterfall effect
203 postgraduate entrance examination Japanese self-study postgraduate entrance examination experience post; Can I learn Japanese by myself?
neo4jDesktop(neo4j桌面版)配置自动启动(开机自启)
Cubemx stm32f105rb USB flash drive reading and writing detailed tutorial
Creating a binary tree (binary linked list) from a generalized table
Register the jar package as a service to realize automatic startup after startup
Wechat official account can reply messages normally, but it still prompts that the service provided by the official account has failed. Please try again later
2022 meisai question a idea sharing
Opencv中的GrabCut图像分割
On the underlying index principle of MySQL
8、智慧交通项目(1)
Online notes on Mathematics for postgraduate entrance examination (9): a series of courses on probability theory and mathematical statistics
Remove the mosaic, there's a way, attached with the running tutorial
oracle 函数 触发器
Data-driven anomaly detection and early warning of 21 May Day C
使用Navicat对比多环境数据库数据差异和结构差异,以及自动DML和DDL脚本
3 big questions! Redis cache exceptions and handling scheme summary