当前位置:网站首页>Notes on writing questions in C language -- free falling ball
Notes on writing questions in C language -- free falling ball
2022-06-23 04:41: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
Use the cycle to find half of the height and add it .
Answer key
#include <stdio.h>
int main()
{
float sn=100.0,hn=sn/2;
int n;
for(n=2;n<=10;n++)
{
sn=sn+2*hn; // The first n The total number of meters passed during the first landing
hn=hn/2; // The first n Second bounce height
}
printf(" Common course %.2f rice \n",sn);
printf(" Ground ten bounce high %.2f rice \n",hn);
}
Sample output


边栏推荐
- 2020:VL-BERT: Pre-training of generic visual-linguistic representation
- flutter系列之:flutter中的Wrap
- It supports running in kubernetes, adds multiple connectors, and seatunnel version 2.1.2 is officially released!
- thinkphp6 无关联ID的连表查询(2张表)主要是select的应用
- Basic skills of x64dbg
- zk 有一个节点报 It is probably not running且日志无明显报错
- OpenJudge NOI 1.13 51:古代密码
- Photoshop PS viewing pixel coordinates, pixel colors, pixel HSB colors
- 32单片机一个变量多个.c里使用
- LabVIEW displays both hexadecimal and normal characters in the same table
猜你喜欢

Zhongang Mining: the demand for fluorite in the new energy and new material industry chain has increased greatly
![3D数学基础[十六] 匀加速直线运动的公式](/img/51/5b05694bbd0f4fd01dd26cf55b22c7.png)
3D数学基础[十六] 匀加速直线运动的公式

Online JSON to CSharp (c) class tool

Imitation 360 desktop suspended ball plug-in

Flutter series: wrap in flutter

什么是元数据

VGG 中草药识别

2020:VL-BERT: Pre-training of generic visual-linguistic representation

#17生成器的函数声明与调用

Cocos学习日记2——脚本和属性
随机推荐
语料库数据处理个案实例(分词和分句、词频统计、排序)
Pta:6-73 function call
麦肯锡:2021年量子计算市场投资增长强劲,人才缺口扩大
Introduction and use of MySQL view
What are the characteristics of SRM supplier management system developed by manufacturing enterprises
应急响应-hw复习
PTA:6-29 虚基类的应用-人与教师学生
【二叉树】翻转等价二叉树
Pta:7-31 journal charges
Tiktok x-bogus and_ Signature parameter analysis
PTA:7-85 数据的间距问题(重载+函数模板)
Dynamics 365 插件中权限操作
JVM调优简要思想及简单案例-为什么需要JVM调优?
Audio and video development journey (63) - animation and rendering of Lottie source code analysis
[deep learning] deep learning reasoning framework tensorrt MNN openvino onnxruntime
Pta:7-63 calculate the number one in the college entrance examination
PTA:6-73 函数调用
OpenJudge NOI 1.13 51:古代密码
关于php里tcp通讯用swoole框架出现的小问题
大一学生课设c——服装管理系统