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


边栏推荐
- 制造型企业开发的SRM供应商管理系统特点是什么
- What is the open source database under Linux
- Latest programming language rankings
- Monitoring artifact ZABBIX, from deployment to application, goes deep layer by layer
- Prince language on insect date class
- OpenJudge NOI 1.13 51:古代密码
- PTA:6-30 时间相加
- How to use shell script to monitor file changes
- After Huawei online battle service players quickly match, different players receive different lists of players in the same room
- Analysis on the current situation of the Internet of things in 2022
猜你喜欢

国家药品不良反应监测中心 ADR 电子传输EDI解决方案

x24Cxx系列EEPROM芯片C语言通用读写程序

② cocoapods原理及 PodSpec 文件上传操作

Basic skills of x64dbg

Halcon glue line detection - template matching, pose transformation, glue width, glue continuity detection

It supports running in kubernetes, adds multiple connectors, and seatunnel version 2.1.2 is officially released!

How to use MySQL index well

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

svg d3. JS generate tree tree view

Mobile terminal city list sorting JS plug-in vertitylist js
随机推荐
OpenJudge NOI 1.13 51:古代密码
How to make the page number start from the specified page in word
Imitation 360 desktop suspended ball plug-in
PTA:7-69 数据的间距问题
Svg+js smart home monitoring grid layout
[binary tree] completeness test of binary tree
Halcon glue line detection - template matching, pose transformation, glue width, glue continuity detection
Kail 渗透基本素养 基础命令
Can MySQL be used in Linux
智能语音时代到来,谁在定义新时代AI?
Deploying Apache pulsar on kubesphere
notepad++ 查找替换之分组替换保留
Software development in 2022: five realities CIOs should know
32单片机一个变量多个.c里使用
golang使用mongo-driver操作——增(基础)
It supports running in kubernetes, adds multiple connectors, and seatunnel version 2.1.2 is officially released!
Pta:6-33 student ranking table (destructor)
Halcon知识:binocular_disparity 知识
How node+express operates cookies
抖音x-bogus和_signature参数分析