当前位置:网站首页>第一章:拓广同码小数和s(d, n)
第一章:拓广同码小数和s(d, n)
2022-07-03 19:16:00 【股_四】
int main()
{
int a, b, d, j, n;
double t, s;
printf(" 请输入整数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;
}
结果:
边栏推荐
- Sentinel source code analysis part I sentinel overview
- Thesis study - 7 Very Deep Convolutional Networks for Large-Scale Image Recognition (3/3)
- 2020 intermediate financial management (escort class)
- Buuctf's different flags and simplerev
- The earliest record
- Streaming media server (16) -- figure out the difference between live broadcast and on-demand
- This Chinese numpy quick look-up table is too easy!
- Basic principle of LSM tree
- 【水质预测】基于matlab模糊神经网络水质预测【含Matlab源码 1923期】
- 【LeetCode】【SQL】刷题笔记
猜你喜欢

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

【数学建模】基于matlab船舶三自由度MMG模型【含Matlab源码 1925期】

【疾病识别】基于matlab GUI机器视觉肺癌检测系统【含Matlab源码 1922期】

东数西算拉动千亿产业,敢啃“硬骨头”的存储厂商才更有机会

The installation path cannot be selected when installing MySQL 8.0.23

The necessity of lean production and management in sheet metal industry

Sentinel source code analysis part I sentinel overview

利用可视化结果,点击出现对应的句子

This Chinese numpy quick look-up table is too easy!

【水质预测】基于matlab模糊神经网络水质预测【含Matlab源码 1923期】
随机推荐
Pecan — @expose()
记录在模拟器中运行flutter时报的错
EGO Planner代码解析bspline_optimizer部分(2)
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
High concurrency architecture cache
Summary of 90 day learning materials and notes of Zhang Fei's actual electronic hardware engineer
Pecan — Overview
Free year-end report summary template Welfare Collection
How to build an efficient information warehouse
Record: MySQL changes the time zone
SQL injection for Web Security (1)
【Proteus仿真】用24C04与1602LCD设计的简易加密电子密码锁
Smart wax therapy machine based on STM32 and smart cloud
Flutter network and data storage framework construction-b1
Scrape crawler framework
【学术相关】顶级论文创新点怎么找?中国高校首次获CVPR最佳学生论文奖有感...
【LeetCode】【SQL】刷题笔记
What does a really excellent CTO look like in my eyes
Work Measurement - 1
[optics] vortex generation based on MATLAB [including Matlab source code 1927]