当前位置:网站首页>Chapter 1: extend the same code decimal sum s (D, n)
Chapter 1: extend the same code decimal sum s (D, n)
2022-07-03 19:21:00 【Shares_ four】
int main()
{
int a, b, d, j, n;
double t, s;
printf(" please enter an integer d, n; ");
scanf("%d, %d", &d, &n);
a = d;
b = 1;
while (a > 0)
{
b = b * 10;
a = a / 10;
}
t = s = 0;
for (j = 1; j <= n; j++)
{
t = t / b + (double)d / b;
s += t;
}
printf(" s(%d, %d) = %.8f\n", d, n, s);
return 0;
}
result :
边栏推荐
- P3402 persistent and searchable
- 01 - QT OpenGL display OpenGL window
- Dynamic planning -- expansion topics
- Summary of 90 day learning materials and notes of Zhang Fei's actual electronic hardware engineer
- Pecan - route
- Le changement est un thème éternel
- Zhang Fei hardware 90 day learning notes - personal records on day 2, please see my personal profile / homepage for the complete
- ActiveMQ的基础
- 我眼中真正优秀的CTO长啥样
- 利用可视化结果,点击出现对应的句子
猜你喜欢

第一章:递归求n的阶乘n!

Record the errors reported when running fluent in the simulator

我眼中真正优秀的CTO长啥样

EGO Planner代码解析bspline_optimizer部分(2)

Ctrip will implement a 3+2 work system in March, with 3 days on duty and 2 days at home every week

记录在模拟器中运行flutter时报的错

第二章:求长方体数组,指定区间内的完全数,改进指定区间内的完全数

第一章:求同吗小数和s(d, n)

I study database at station B (4): DQL

Simulation scheduling problem of SystemVerilog (1)
随机推荐
Zhang Fei hardware 90 day learning notes - personal record on day 6. Please see my personal profile / homepage for the complete record
How to build an efficient information warehouse
Zhang Fei hardware 90 day learning notes - personal records on day 4, please see my personal profile / homepage for the complete
Pytorch introduction to deep learning practice notes 13- advanced chapter of cyclic neural network - Classification
QT -- qfile file read / write operation
Compared with 4G, what are the advantages of 5g to meet the technical requirements of industry 4.0
Le changement est un thème éternel
During MySQL installation, the download interface is empty, and the components to be downloaded are not displayed. MySQL installer 8.0.28.0 download interface is empty solution
Today I am filled with emotion
Random numbers in a long range, is that right- Random number in long range, is this the way?
[disease identification] machine vision lung cancer detection system based on Matlab GUI [including Matlab source code 1922]
SSM integration - joint debugging of front and rear protocols (list function, add function, add function status processing, modify function, delete function)
Counting from the East and counting from the West will stimulate 100 billion industries. Only storage manufacturers who dare to bite the "hard bone" will have more opportunities
Record: pymysql is used in pycharm to connect to the database
2020 intermediate financial management (escort class)
为什么要做特征的归一化/标准化?
Simple solution of physical backup and restore of Damon database
[water quality prediction] water quality prediction based on MATLAB Fuzzy Neural Network [including Matlab source code 1923]
Flutter网络和数据存储框架搭建 -b1
Day10 ---- 强制登录, token刷新与jwt禁用