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


边栏推荐
- Remittance international empowers cross-border e-commerce: to be a compliant cross-border payment platform!
- [zufe school competition] difficulty classification and competition suggestions of common competitions in the school (taking Zhejiang University of Finance and economics as an example)
- manhattan_slam环境配置
- 通过客户经理的开户二维码开股票账户安全吗?
- 匯付國際為跨境電商賦能:做合規的跨境支付平臺!
- x86的编码格式
- Matplotlib decision boundary drawing function plot in Matplotlib_ decision_ Boundary and plt Detailed explanation of contour function
- How to download the school logo, school name and corporate logo on a transparent background without matting
- Reza RA series - development environment construction
- 【mysql学习笔记20】mysql体系结构
猜你喜欢

Matplotlib decision boundary drawing function plot in Matplotlib_ decision_ Boundary and plt Detailed explanation of contour function

Explanation of assertions in JMeter

Huipay international permet au commerce électronique transfrontalier de devenir une plate - forme de paiement transfrontalière conforme!

Compare and explain common i/o models

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

C语言刷题随记 —— 猴子吃桃

使用Navicat对比多环境数据库数据差异和结构差异,以及自动DML和DDL脚本

22 mathematical modeling contest 22 contest C

Applet cloud development joint table data query and application in cloud function

Solution to the problem of repeated startup of esp8266
随机推荐
Are the top ten securities companies at great risk of opening accounts and safe and reliable?
Voiceprint Technology (VI): other applications of voiceprint Technology
高速缓冲存储器Cache的映射方式
手机办理长城证券开户靠谱安全吗?
puzzle(019.2)六边锁
Voiceprint Technology (VII): the future of voiceprint Technology
测试开发工程师
Applet cloud development joint table data query and application in cloud function
3 big questions! Redis cache exceptions and handling scheme summary
Oracle function trigger
CSV parameterization in JMeter
Arduino bootloader burning summary
Huipay international permet au commerce électronique transfrontalier de devenir une plate - forme de paiement transfrontalière conforme!
浅谈Mysql底层索引原理
SQL advanced
[buuctf.reverse] 121-125
华泰证券在上面开户安全吗?靠谱吗?
With the QQ group file storage function of super nice, you immediately have n cloud disks that are easy to download and never expire
通过客户经理的开户二维码开股票账户安全吗?
matplotlib matplotlib中axvline()和axhline()函数