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


边栏推荐
- Summarize two methods of configuring pytorch GPU environment
- Analysis on the bottom calling process of micro service calling component ribbon
- 纳米数据世界杯数据接口,中超数据,体育数据比分,世界杯赛程api,足球比赛实时数据接口
- Wallys/MULTI-FUNCTION IPQ6010 (IPQ6018 FAMILY) EMBEDDED BOARD WITH ON-BOARD WIFI DUAL BAND DUAL
- 使用EVO
- [zufe expense reimbursement] zhecai invoice reimbursement specification (taking Xinmiao reimbursement as an example), which can be passed in one trip at most
- Title B of the certification cup of the pistar cluster in the Ibagu catalog
- 在指南针上面开户好不好,安不安全?
- Cubemx stm32f105rb USB flash drive reading and writing detailed tutorial
- Is it safe to open a stock account on the compass?
猜你喜欢
![[matlab] image binarization (imbinarize function)](/img/3e/066f460d9f436bbc43ea35e46093e2.jpg)
[matlab] image binarization (imbinarize function)

Question B of the East China Cup: how to establish a population immune barrier against novel coronavirus?

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

首期Techo Day腾讯技术开放日,628等你!

How much money have I made by sticking to fixed investment for 3 years?

2021mathorcupc topic optimal design of heat dissipation for submarine data center

The first techo day Tencent technology open day, 628 waiting for you!

Benefits and types of cloud network technology

Wallys/MULTI-FUNCTION IPQ6010 (IPQ6018 FAMILY) EMBEDDED BOARD WITH ON-BOARD WIFI DUAL BAND DUAL

Cassava tree disease recognition based on vgg16 image classification
随机推荐
2022 meisai question a idea sharing
The meshgrid() function in numpy
Wallys/MULTI-FUNCTION IPQ6010 (IPQ6018 FAMILY) EMBEDDED BOARD WITH ON-BOARD WIFI DUAL BAND DUAL
Online notes on Mathematics for postgraduate entrance examination (8): Kego equations, eigenvalues and eigenvectors, similarity matrix, quadratic series courses
Mapping mode of cache
Use Navicat to compare data differences and structure differences of multi environment databases, and automatic DML and DDL scripts
Prediction of pumpkin price based on BP neural network
Is the client that gets the scanning code wechat or Alipay
汇付国际为跨境电商赋能:做合规的跨境支付平台!
I put a two-dimensional code with rainbow candy
Is it safe to open an account with Great Wall Securities by mobile phone?
Online notes on Mathematics for postgraduate entrance examination (9): a series of courses on probability theory and mathematical statistics
SQL advanced
【mysql学习笔记20】mysql体系结构
x86的编码格式
[zufe school competition] difficulty classification and competition suggestions of common competitions in the school (taking Zhejiang University of Finance and economics as an example)
Matplotlib axvline() and axhline() functions in Matplotlib
Title B of the certification cup of the pistar cluster in the Ibagu catalog
Oracle one line function Encyclopedia
Arduino bootloader burning summary