1104. Sum of Number Segments (20)
来源:互联网 发布:毛昆仑 常凯申 知乎 编辑:程序博客网 时间:2024/05/17 09:27
题目:https://www.patest.cn/contests/pat-a-practise/1104
代码:
#include<cstdio>#include<cstring>#include<cstdlib>#include<algorithm>using namespace std;int main(){ int n;double sum=0.0,temp;scanf("%d",&n);for(int i=1;i<=n;i++){ scanf("%lf",&temp); sum+=temp*i*(n+1-i);}printf("%.2lf\n",sum);system("pause");}
0 0
- 【PAT】1104. Sum of Number Segments (20)
- 1104. Sum of Number Segments (20)
- 1104. Sum of Number Segments (20)
- 1104. Sum of Number Segments (20)
- PAT 1104. Sum of Number Segments (20)
- 1104. Sum of Number Segments (20)
- 1104. Sum of Number Segments (20)
- PAT 1104. Sum of Number Segments (20)
- 1104. Sum of Number Segments (20)
- [pat]1104. Sum of Number Segments (20)
- 1104. Sum of Number Segments (20)
- 1104. Sum of Number Segments (20)
- 1104. Sum of Number Segments (20)
- 1104. Sum of Number Segments (20)
- 1104. Sum of Number Segments (20)
- PAT 1104. Sum of Number Segments (20)
- 1104. Sum of Number Segments (20)
- 1104.Sum of Number Segments (20)
- Linux中常用操作命令
- 内核开发:实现切换窗口后的键盘输入
- 1112. Stucked Keyboard (20)
- display:inline-block和元素水平居中的关系
- Trie树标准模版
- 1104. Sum of Number Segments (20)
- 学习方法摘录
- 深入了解View的绘制流程
- Understanding LSTM Networks
- flask成长记(六)
- UWP开发技巧:实现SMB协议操作文件服务器文件
- LeetCode_292. Nim Game
- 编写函数void change(char *a,char *b,char*c)。
- 2017.1.30 Java有感3.2