当前位置:网站首页>学习-用do…while循环按公式e=1+1/1!+1/2!+1/3!+…+1/n!计算 e 的值(精度为 1e-6)
学习-用do…while循环按公式e=1+1/1!+1/2!+1/3!+…+1/n!计算 e 的值(精度为 1e-6)
2022-07-24 08:00:00 【Ssaty.】
第1关:用do-while循环按公式e=1+1/1!+1/2!+1/3!+…+1/n!计算 e 的值
本关任务:编写程序用do-while循环按公式e=1+1/1!+1/2!+1/3!+…+1/n!计算 e 的值,直到最后一项的绝对值小于精度值eps时为止,输出e的值并统计累加的项数。
do-while语句的特点:先无条件地执行循环体,然后判断循环条件是否成立。
do-while循环与while循环的不同在于:do-while循环是先执行循环中的语句,然后再判断表达式是否为真,如果为真则继续循环;如果为假,则终止循环。
do-while循环至少要执行一次循环语句。
#include <stdio.h>
int main()
{
/********** Begin **********/
<边栏推荐
- Use of ArrayList
- Starting from scratch C language intensive Part 3: Functions
- About how to set colored fonts on the terminal
- 避坑,职场远离PUA,PUA常见的套路与话术你得了解一下!
- mysql使用explain分析sql执行计划帮助查找性能瓶颈
- 33 introduction to sparksql, dataframe and dataset
- EZDML逆向工程导入数据库分析实操教程
- Hegong sky team vision training day4 - traditional vision, contour recognition
- JMeter stress test index interpretation
- The solution of unable to import custom library in pycharm
猜你喜欢

Stable TTL serial port rate supported by Arduino under different dominant frequencies

Why is knowledge base important? This is the best answer I've ever heard

Full revolutionary Siamese networks for object tracking translation
![[Beijiao] image processing: basic concepts, image enhancement, morphological processing, image segmentation](/img/b3/76d2bcdf4b9769fb6308b7dac9ceb5.jpg)
[Beijiao] image processing: basic concepts, image enhancement, morphological processing, image segmentation

Summary of study notes (I)

【MATLAB】(四)MATLAB在线性代数中的应用
![[matlab] (IV) application of MATLAB in linear algebra](/img/c8/97fddb4105008990173247b1b4a155.png)
[matlab] (IV) application of MATLAB in linear algebra

Facing Tencent (actual combat) - Test Development - detailed explanation of interns (face experience)

JMeter stress test index interpretation

Starting from scratch C language intensive Part 3: Functions
随机推荐
2021-06-03 database query - sorting
The difference between session and cookie
Intelligent robots and intelligent systems (Professor Zheng Zheng of Dalian University of Technology) -- 1. robots and mobile robots
13. Unity2d horizontal version of two-way platform that can move up, down, left and right (two-way walking + movable + independent judgment) + random platform generation
P3916图的遍历 题解
jmeter中JSON提取器使用
Hcip day 8 notes
Learning dynamic Siamese network for visual object tracking full text translation
MySQL 啥时候用表锁,啥时候用行锁?
Selenium basics controls the scroll bar of the browser
mysql使用explain分析sql执行计划帮助查找性能瓶颈
App performance test case
Have you seen the interview questions of VR major? Trust me, it's absolutely useful
Collection of linked list topics
Detailed notes on pytoch building neural network
HCIP第十天笔记
我在微软的这六个月
【线性代数】深入理解矩阵乘法、对称矩阵、正定矩阵
Why is knowledge base important? This is the best answer I've ever heard
Natural language processing hanlp