[Poj1004]Financial Management
来源:互联网 发布:net域名后缀排名高吗 编辑:程序博客网 时间:2024/04/24 16:38
新人来了,先水一道PKU上的大水题吧。。。
Larry graduated this year and finally has a job. He's making a lot of money, but somehow never seems to have enough. Larry has decided that he needs to grab hold of his financial portfolio and solve his financing problems. The first step is to figure out what's been going on with his money. Larry has his bank account statements and wants to see how much money he has. Help Larry by writing a program to take his closing balance from each of the past twelve months and calculate his average account balance.
思路:没什么好说的,真的是很水。无非是循环一遍读入及求和,最后取平均数。。。
就是要注意使用double类型。。。
#include<iostream>#include<iomanip>using namespace std;double a[13],sum,ans;int main(){int i;sum=0;for(i=1;i<=12;i++){cin>>a[i];sum+=a[i];}ans=sum/12.0;cout<<"$";cout<<fixed<<setprecision(2)<<ans<<endl;}
1 0
- POJ1004·Financial Management
- POJ1004 Financial Management
- POJ1004 Financial Management
- POJ1004:Financial Management
- poj1004---Financial Management
- POJ1004 Financial Management
- POJ1004---Financial Management
- POJ1004 Financial Management
- [Poj1004]Financial Management
- POJ1004 Financial Management
- poj1004 Financial Management
- POJ1004 && Financial Management
- poj1004 Financial Management
- POJ1004 Financial Management
- POJ1004-Financial Management
- poj1004"Financial Management"解题报告
- poj1004——Financial Management
- POJ1004-Financial Management(水题)
- MAC安装并破解PhpStorm-9.0.2 记录(附下载链接)
- 响应式布局
- Java中的集合类型的迭代器(Iterator)
- 【July程序员编程艺术】之字符串左旋
- Leetcode86: Missing Number
- [Poj1004]Financial Management
- android图片模糊的效果
- LP/QP/QCQP/SOCP/SDP/CCCP等系列优化方法的比较
- uva 11468 ac自动机+dp
- 新东西010--Android targetSdkVersion解析
- 【SQL优化】四月份培训的一个sql优化案例1
- linux安装vim
- GemFI安装中的'Error: can't find library -lpthread required by python'
- 黑马程序员---成长之路-----OC之基础篇创建对象