这道题提醒了我一个问题,怎么在while(cin>>a[i])下中断

 #include<iostream>
#include<cmath>
#include<iomanip>
using namespace std; int main()
{
double a[];
int i = ;
double sum = ;
for(i = ;i<;i++)
{
cin>>a[i];
sum+=a[i];
}
cout<<fixed<<setprecision()<<"$"<<sum/<<endl;
}

zoj 1048的更多相关文章

  1. ZOJ 1048 Financial Management

    原题链接 题目大意:给出12个月的收入,求一个平均值. 解法:没什么好说的,就是一个除法. 参考代码: #include<stdio.h> int main(){ int i; float ...

  2. ZOJ Problem Set - 1048 Financial Management

    我承认这是一道水的不能再水的题,今天一下就做到了,还是无耻的帖上来吧 #include <stdio.h> int main() { double sum=0; for(int i=1;i ...

  3. ZOJ题目分类

    ZOJ题目分类初学者题: 1001 1037 1048 1049 1051 1067 1115 1151 1201 1205 1216 1240 1241 1242 1251 1292 1331 13 ...

  4. ZOJ People Counting

    第十三届浙江省大学生程序设计竞赛 I 题, 一道模拟题. ZOJ  3944http://www.icpc.moe/onlinejudge/showProblem.do?problemCode=394 ...

  5. ZOJ 3686 A Simple Tree Problem

    A Simple Tree Problem Time Limit: 3 Seconds      Memory Limit: 65536 KB Given a rooted tree, each no ...

  6. ZOJ Problem Set - 1394 Polar Explorer

    这道题目还是简单的,但是自己WA了好几次,总结下: 1.对输入的总结,加上上次ZOJ Problem Set - 1334 Basically Speaking ac代码及总结这道题目的总结 题目要求 ...

  7. ZOJ Problem Set - 1392 The Hardest Problem Ever

    放了一个长长的暑假,可能是这辈子最后一个这么长的暑假了吧,呵呵...今天来实验室了,先找了zoj上面简单的题目练练手直接贴代码了,不解释,就是一道简单的密文转换问题: #include <std ...

  8. ZOJ Problem Set - 1049 I Think I Need a Houseboat

    这道题目说白了是一道平面几何的数学问题,重在理解题目的意思: 题目说,弗雷德想买地盖房养老,但是土地每年会被密西西比河淹掉一部分,而且经调查是以半圆形的方式淹没的,每年淹没50平方英里,以初始水岸线为 ...

  9. ZOJ Problem Set - 1006 Do the Untwist

    今天在ZOJ上做了道很简单的题目是关于加密解密问题的,此题的关键点就在于求余的逆运算: 比如假设都是正整数 A=(B-C)%D 则 B - C = D*n + A 其中 A < D 移项 B = ...

随机推荐

  1. centos和ubuntu配置路由的三种方式

    本篇总结三种修改路由的方式:route, ip route, 以及通过修改文件来配置路由,前2种命令行形式适用于ubuntu和centos,重启失效,最后一种永久有效.     一. route命令 ...

  2. Spring中applicationContext.xml详解

    <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.sp ...

  3. 【算法笔记】A1054 The Dominant Color

    1054 The Dominant Color (20 分)   Behind the scenes in the computer's memory, color is always talked ...

  4. LOJ2229. 「BJOI2014」想法(随机化)

    题目链接 https://loj.ac/problem/2229 题解 评分标准提示我们可以使用随机化算法. 首先,我们为每一道编号在 \([1, m]\) 以内的题目(这些题目也对应了 \(m\) ...

  5. FZU_1894 志愿者选拔 【单调队列】

    1 题面 FZU1894 2 分析 单调队列的典型引用 需要注意的是在用维护辅助队列的时候,$L$和$R$的初始化都是0时,队列第一个数就是$L$,最后一个数就是$R-1$. 3 AC代码 #incl ...

  6. (转)Python3 日期和时间

    Python 程序能用很多方式处理日期和时间,转换日期格式是一个常见的功能. Python 提供了一个 time 和 calendar 模块可以用于格式化日期和时间. 时间间隔是以秒为单位的浮点小数. ...

  7. 【ZooKeeper】单机伪集群搭建(适用于mac)

    1.配置 .zookeeper下载地址:http://apache.mirrors.lucidnetworks.net/zookeeper/ 可以选择需要的版本,我下载的是zookeeper-3.4. ...

  8. 【数组】Two Sum

    题目: Given an array of integers, find two numbers such that they add up to a specific target number. ...

  9. Table '.\gts\eventdata#P#p0' is marked as crashed and last (automatic?) repair failed

    修复数据表操 MYSQL数据表出现问题,提示:Error: Table './db_name/table_name' is marked as crashed and last (automatic? ...

  10. disable Nouveau kernel driver

    nano /etc/modprobe.d/blacklist-nouveau.conf with the following contents: blacklist nouveau options n ...