当前位置:网站首页>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;
}
边栏推荐
- Use of constraintlayout
- Understand the application scenario and implementation mechanism of differential segment
- Zhonggan micro sprint technology innovation board: annual revenue of 240million, net loss of 17.82 million, proposed to raise 600million
- Facebook 如何将 Instagram 从 AWS 搬到自己的服务器
- Stop asking yourself if you are suitable for software testing
- NFT new opportunity, multimedia NFT aggregation platform okaleido will be launched soon
- 亚马逊、速卖通、Lazada、Shopee、eBay、wish、沃尔玛、阿里国际、美客多等跨境电商平台,测评自养号该如何利用产品上新期抓住流量?
- Doris学习笔记之数据表的创建
- Four data flows and cases of grpc
- 7-17 crawling worms (break exercise)
猜你喜欢
npm install卡住与node-npy的各种奇怪报错
Mysql多表查询 #子查询
ConstraintLayout 的使用
tonybot 人形机器人 定距移动 代码编写玩法
Luogu p4047 [jsoi2010] tribal division solution
Bibit pharmaceutical rushed to the scientific innovation board: annual revenue of 970000, loss of 137million, proposed to raise 2billion
中感微冲刺科创板:年营收2.4亿净亏1782万 拟募资6亿
泰凌冲刺科创板:拟募资13亿 国家大基金与小米长江是股东
556. 下一个更大元素 III
GRPC的四种数据流以及案例
随机推荐
Get permissions dynamically
7-19 check denomination (solve binary linear equation)
Luogu p3065 [usaco12dec]first! G problem solution
7-14 sum integer segments (C language)
关于敏捷的一些概念
Showmebug entered Tencent conference, opening the era of professional technical interview
愉悦资本新双币基金近40亿元完成首次关账
tonybot 人形机器人 首次开机 0630
适用于XP的DDK
GRPC的四种数据流以及案例
修改数据库中的记录为什么报这个错
Tailing rushes to the scientific and Technological Innovation Board: it plans to raise 1.3 billion, and Xiaomi Changjiang is the shareholder
Output student grades
Frequently asked questions: PHP LDAP_ add(): Add: Undefined attribute type in
Zabbix添加Calculated items后保存页面成空白
Time conversion ()
Selective sorting
Stop asking yourself if you are suitable for software testing
如何查询淘宝天猫的宝贝类目
Too many files with unapproved license