当前位置:网站首页>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 :
边栏推荐
- Day11 ---- 我的页面, 用户信息获取修改与频道接口
- What does a really excellent CTO look like in my eyes
- I study database at station B (4): DQL
- Zhang Fei hardware 90 day learning notes - personal record on day 5. Please see my personal profile / homepage for the complete record
- Record: MySQL changes the time zone
- SQL injection for Web Security (1)
- 第一章:拓广同码小数和s(d, n)
- SSM integration - joint debugging of front and rear protocols (list function, add function, add function status processing, modify function, delete function)
- 我们做了一个智能零售结算平台
- Analysis of dart JSON encoder and decoder
猜你喜欢
Using the visualization results, click to appear the corresponding sentence
第一章:求奇因数代数和,求同吗小数和s(d, n),简化同码小数和s(d, n),拓广同码小数和s(d, n)
第二章:4位卡普雷卡数,搜索偶数位卡普雷卡数,搜索n位2段和平方数,m位不含0的巧妙平方数,指定数字组成没有重复数字的7位平方数,求指定区间内的勾股数组,求指定区间内的倒立勾股数组
Record the errors reported when running fluent in the simulator
Sentinel source code analysis part II - sentinel dashboard console startup and configuration
We have built an intelligent retail settlement platform
Foundation of ActiveMQ
Streaming media server (16) -- figure out the difference between live broadcast and on-demand
第一章:简化同码小数和s(d, n)
Day_ 18 IO stream system
随机推荐
Merge K ascending linked lists
【LeetCode】【SQL】刷题笔记
我眼中真正优秀的CTO长啥样
Day10 ---- 强制登录, token刷新与jwt禁用
Day11 ---- 我的页面, 用户信息获取修改与频道接口
Le changement est un thème éternel
第一章:求奇因数代数和,求同吗小数和s(d, n),简化同码小数和s(d, n),拓广同码小数和s(d, n)
第二章:4位卡普雷卡数,搜索偶数位卡普雷卡数,搜索n位2段和平方数,m位不含0的巧妙平方数,指定数字组成没有重复数字的7位平方数,求指定区间内的勾股数组,求指定区间内的倒立勾股数组
Floating source code comment (38) parallel job processor
Common text labels
Think of new ways
flask 生成swagger文档
Succession of flutter
These problems should be paid attention to in the production of enterprise promotional videos
The most valuable thing
Ego planner code parsing Bspline_ Optimizer section (3)
What is the content of game modeling
Integrated easy to pay secondary domain name distribution system
EGO Planner代码解析bspline_optimizer部分(1)
Recommend a GIF processing artifact less than 300K - gifsicle (free download)