当前位置:网站首页>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 :
边栏推荐
- Le changement est un thème éternel
- Day18 - basis of interface testing
- Record: pymysql is used in pycharm to connect to the database
- Webrtc[41] - Analysis of the establishment process of webrtc transmission channel
- 02 -- QT OpenGL drawing triangle
- flask 生成swagger文档
- 交叉编译Opencv带Contrib
- Scrapy爬虫框架
- P3402 persistent and searchable
- Basic principle of LSM tree
猜你喜欢

第一章:简化同码小数和s(d, n)

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

【学术相关】顶级论文创新点怎么找?中国高校首次获CVPR最佳学生论文奖有感...

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

The online customer service system developed by PHP is fully open source without encryption, and supports wechat customer service docking

第一章:求所有阶乘和数,大奖赛现场统分程序设计,三位阶乘和数,图形点扫描,递归求n的阶乘n!,求n的阶乘n!,舍罕王失算

2020 intermediate financial management (escort class)

Integrated easy to pay secondary domain name distribution system

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

【光学】基于matlab涡旋光产生【含Matlab源码 1927期】
随机推荐
【LeetCode】【SQL】刷题笔记
Record: install MySQL on ubuntu18.04
[mathematical modeling] ship three degree of freedom MMG model based on MATLAB [including Matlab source code 1925]
Pecan - route
High concurrency Architecture - distributed search engine (ES)
FBI警告:有人利用AI换脸冒充他人身份进行远程面试
第一章:求同吗小数和s(d, n)
第二章:基于分解的求水仙花数,基于组合的求水仙花数, 兰德尔数,求[x,y]内的守形数,探求n位守形数,递推探索n位逐位整除数
What is the content of game modeling
Le changement est un thème éternel
第一章:递归求n的阶乘n!
Record: solve the problem that MySQL is not an internal or external command environment variable
交叉编译Opencv带Contrib
Simple solution of physical backup and restore of Damon database
Summary of learning materials and notes of Zhang Fei's actual combat electronics 1-31
Octopus online ecological chain tour Atocha protocol received near grant worth $50000
我們做了一個智能零售結算平臺
01. Preparation for automated office (free guidance, only three steps)
[optics] dielectric constant calculation based on MATLAB [including Matlab source code 1926]
【光学】基于matlab介电常数计算【含Matlab源码 1926期】