POJ 1004 Financial Management 水



Financial Management

Time Limit: 1000MS   Memory Limit: 10000K
Total Submissions: 165700   Accepted: 61629

Description

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.

Input

The input will be twelve lines. Each line will contain the closing balance of his bank account for a particular month. Each number will be positive and displayed to the penny. No dollar sign will be included.

Output

The output will be a single number, the average (mean) of the closing balances for the twelve months. It will be rounded to the nearest penny, preceded immediately by a dollar sign, and followed by the end-of-line. There will be
no other spaces or characters in the output.

Sample Input

100.00
489.12
12454.12
1234.10
823.05
109.205.27
1542.25
839.18
83.99
1295.01
1.75
Sample Output
$1581.42
Source
Mid-Atlantic 2001
ac代码:
#include <iostream>
#include <cstdio>
using namespace std;
int main(){
    double a[12],sum=0;
    for(int i=0;i<12;++i){
        cin>>a[i];
        sum+=a[i];
    }
    printf("$%.2f",sum/12);
    return 0;
}

版权声明:本文为博主原创文章,未经博主允许不得转载。

时间: 2024-10-10 19:50:36

POJ 1004 Financial Management 水的相关文章

poj 1004:Financial Management(水题,求平均数)

Financial Management Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 126087   Accepted: 55836 Description 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 deci

POJ 1004 Financial Management

#include <stdio.h> #include <iostream> using namespace std; int main() { int n=12; float money,sum=0; for(int i=0;i<12;i++) { cin>>money; sum+=money; } printf("$%.2f", sum/12); return 0; }

UVA 11945 Financial Management 水题

Financial Management Time Limit: 1 Sec  Memory Limit: 256 MB 题目连接 acm.hust.edu.cn/vjudge/problem/visitOriginUrl.action?id=20184 Description Michael graduated of ITESO this year and finally has a job. He's making a lot of money, but somehow never seem

[POJ] Financial Management

Financial Management Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 182193   Accepted: 68783 Description 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 deci

UVALive2362 POJ1004 HDU1064 ZOJ1048 Financial Management

Regionals 2001 >> North America - Mid-Atlantic USA 问题链接:UVALive2362 POJ1004 HDU1064 ZOJ1048 Financial Management. 题意简述:输入12个数,计算其平均值. 编写程序时,考虑到C++处理输入比较方便,所以使用C++语言编程.然而,输出需要指定格式是还是C语言方便,所以就用函数printf()来处理输出. AC的C语言程序如下: /* UVALive2362 POJ1004 HDU106

poj 2369 Permutations 置换水题

找循环节求lcm就够了,若答案是12345应该输出1,被坑了下. #include<iostream> #include<cstdio> #include<cstring> #include<string> #include<algorithm> #include<cmath> using namespace std; #define INF 0x3FFFFFF #define MAXN 2222 #define eps 1e-6 i

poj 1004 Dividing

题目大意是,从输入六个数 ,第i个数代表价值为i的有几个,平均分给两个人 ,明摆着的背包问题,本来以为把他转化为01背包,但是TLe,后来发现是12万的平方还多,所以妥妥的TLE,后来发现这是一个完全背包问题,然后即纠结了 ,没学过啊 ,最后发现思想好i是蛮简单的,水水的A掉了,最后注意一下初始化问题和输入问题后就好了 #include <stdio.h> #include <string.h> int a[10]; int dp[120005]; int maxx(int a,i

POJ Octal Fractions(JAVA水过)

题目链接:CLICK HERE~ 虽然java一下模拟水过,但是我看到别人的一段神奇代码,贴出和大家共享. import java.math.*; import java.util.*; class Main{ public static void main(String args[]){ Scanner cin = new Scanner(System.in); BigDecimal Eight = new BigDecimal(8); while(cin.hasNext()){ String

poj 1006:Biorhythms(水题,经典题,中国剩余定理)

Biorhythms Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 110991   Accepted: 34541 Description Some people believe that there are three cycles in a person's life that start the day he or she is born. These three cycles are the physical,