当前位置:网站首页>第一章:拓广同码小数和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;
}
结果:
边栏推荐
- 2022.2.14 Li Kou - daily question - single element in an ordered array
- Common text labels
- [proteus simulation] a simple encrypted electronic password lock designed with 24C04 and 1602LCD
- Flutter network and data storage framework construction-b1
- Octopus online ecological chain tour Atocha protocol received near grant worth $50000
- Analysis of dart JSON encoder and decoder
- I study database at station B (4): DQL
- If the warehouse management communication is not in place, what problems will occur?
- 【LeetCode】【SQL】刷题笔记
- BUUCTF
猜你喜欢
Why should the gradient be manually cleared before back propagation in pytorch?
Record: install MySQL on ubuntu18.04
A green plug-in that allows you to stay focused, live and work hard
Day18 - basis of interface testing
Record the errors reported when running fluent in the simulator
Free hand account sharing in September - [cream Nebula]
Sentinel source code analysis part I sentinel overview
Flume learning notes
【Proteus仿真】用24C04与1602LCD设计的简易加密电子密码锁
我们做了一个智能零售结算平台
随机推荐
“google is not defined” when using Google Maps V3 in Firefox remotely
Record: install MySQL on ubuntu18.04
How does if ($variable) work? [repeat] - how exactly does if ($variable) work? [duplicate]
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
Octopus online ecological chain tour Atocha protocol received near grant worth $50000
Pecan - route
Analysis of dart JSON encoder and decoder
The necessity of lean production and management in sheet metal industry
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
我們做了一個智能零售結算平臺
[academic related] how to find the innovation of top papers? Chinese universities won the CVPR Best Student Thesis Award for the first time
我眼中真正优秀的CTO长啥样
为什么要做特征的归一化/标准化?
The online customer service system developed by PHP is fully open source without encryption, and supports wechat customer service docking
Sqlalchemy - subquery in a where clause - Sqlalchemy - subquery in a where clause
[free sharing] kotalog diary2022 plan electronic manual ledger
Pecan — Overview
Sentinel source code analysis part II - sentinel dashboard console startup and configuration
[leetcode] [SQL] notes
Record: MySQL changes the time zone