当前位置:网站首页>Zzuli: sum of 1051 square roots
Zzuli: sum of 1051 square roots
2022-07-03 14:34:00 【Snake_____】
Title Description
The definition of sequence is as follows :
The first term of the sequence is item, Later items are the square root of the previous item , Find the front of the sequence n Sum of items .
Input
By two integers item(item<10000) and n(n<1000) form ,item and n Has the meaning set forth above .
Output
Output the sum of the sequence , Occupy a line , Precision retention required 2 Decimal place .
The sample input Copy
84 4
Sample output Copy
97.93
#include <stdio.h>
#include <math.h>
int main()
{
int n,i;
double item,sum=0;
scanf("%lf%d",&item,&n);
for(i=1;i<=n;i++)
{
sum=sum+item;
item=sqrt(item);
}
printf("%.2lf",sum);
return 0;
}边栏推荐
- Jiuyi cloud black free encryption free version source code
- 洛谷P5194 [USACO05DEC]Scales S 题解
- Luogu p5018 [noip2018 popularization group] symmetric binary tree problem solution
- Tonybot humanoid robot starts for the first time 0630
- DDK for XP
- Zabbix添加Calculated items后保存页面成空白
- Time conversion ()
- Puzzle (016.3) is inextricably linked
- Adc128s022 ADC Verilog design and Implementation
- 1017 a divided by B (20 points)
猜你喜欢

常见问题之PHP——ldap_add(): Add: Undefined attribute type in

7-18 finding the single root of polynomial by dichotomy

Eight sorts

Tiantu investment sprint Hong Kong stocks: asset management scale of 24.9 billion, invested in xiaohongshu and Naixue

Happy capital new dual currency fund nearly 4billion yuan completed its first account closing

556. The next larger element III

Sub GHz wireless solution Z-Wave 800 Series zg23 SOC and zgm230s modules

Adc128s022 ADC Verilog design and Implementation
![洛谷P5018 [NOIP2018 普及组] 对称二叉树 题解](/img/89/da1a3a38e02671628f385de0f30369.png)
洛谷P5018 [NOIP2018 普及组] 对称二叉树 题解

puzzle(016.4)多米诺效应
随机推荐
数学常数表 by q779
C language,%d% Difference between 2D%2d%02d
Although not necessarily the best, it must be the hardest!
Time conversion ()
Statistical capital consonants
puzzle(016.3)千丝万缕
分布式事务(Seata) 四大模式详解
Mongodb index
NFT新的契机,多媒体NFT聚合平台OKALEIDO即将上线
Raft agreement
7-3 count the number of words in a line of text
Stop asking yourself if you are suitable for software testing
7-6 mixed type data format input
7-4 BCD decryption (10 points)
String sort
Tonybot humanoid robot checks the port and corresponds to port 0701
7-2 and then what time (15 minutes)
String reverse order
基因家族特征分析 - 染色体定位分析
Doris学习笔记之数据表的创建