当前位置:网站首页>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 :
边栏推荐
- Flutter网络和数据存储框架搭建 -b1
- 记录在模拟器中运行flutter时报的错
- 第一章:求n的阶乘n!
- Dart JSON编码器和解码器剖析
- 我们做了一个智能零售结算平台
- 【学术相关】顶级论文创新点怎么找?中国高校首次获CVPR最佳学生论文奖有感...
- Streaming media server (16) -- figure out the difference between live broadcast and on-demand
- Simple solution of physical backup and restore of Damon database
- The space of C disk is insufficient, and the computer becomes stuck. Quickly expand the capacity of C disk to make the system more smooth
- Common text labels
猜你喜欢

Merge K ascending linked lists

【水质预测】基于matlab模糊神经网络水质预测【含Matlab源码 1923期】

DriveSeg:动态驾驶场景分割数据集

Think of new ways

Record the errors reported when running fluent in the simulator

Octopus online ecological chain tour Atocha protocol received near grant worth $50000

FBI warning: some people use AI to disguise themselves as others for remote interview

Flume learning notes
![[mathematical modeling] ship three degree of freedom MMG model based on MATLAB [including Matlab source code 1925]](/img/a9/d89ee2b88517eea6b3c38d72cf099f.jpg)
[mathematical modeling] ship three degree of freedom MMG model based on MATLAB [including Matlab source code 1925]
![[disease identification] machine vision lung cancer detection system based on Matlab GUI [including Matlab source code 1922]](/img/fc/00835b95537cf889588502a3d13bc9.png)
[disease identification] machine vision lung cancer detection system based on Matlab GUI [including Matlab source code 1922]
随机推荐
[proteus simulation] a simple encrypted electronic password lock designed with 24C04 and 1602LCD
變化是永恒的主題
Latex image rotates with title
If the warehouse management communication is not in place, what problems will occur?
We have built an intelligent retail settlement platform
第一章:递归求n的阶乘n!
第二章:求长方体数组,指定区间内的完全数,改进指定区间内的完全数
Analyse du Code du planificateur ego bspline Section Optimizer (1)
SSM整合-前后台协议联调(列表功能、添加功能、添加功能状态处理、修改功能、删除功能)
Merge K ascending linked lists
What is the content of game modeling
EGO Planner代碼解析bspline_optimizer部分(1)
Pecan - route
[disease identification] machine vision lung cancer detection system based on Matlab GUI [including Matlab source code 1922]
Zhang Fei hardware 90 day learning notes - personal record on day 6. Please see my personal profile / homepage for the complete record
QT -- qfile file read / write operation
利用可视化结果,点击出现对应的句子
Pecan — @expose()
【光学】基于matlab介电常数计算【含Matlab源码 1926期】
Does SQL always report foreign key errors when creating tables?