#include <iostream>
#include <cctype>
using namespace std;
const int MAXSIZE=10;
int main()
{
double dd[MAXSIZE];
double donation;
double aver=0;
int num=0;
int i=0;
while(i<MAXSIZE && cin>>donation && !isdigit(donation))
{
dd[i]=donation;
aver+=dd[i];
i++;
//(cin>>donation).get();
}
if(i)
aver=aver/i;
else aver=0;
for(int j=0;j<i;j++)
if(dd[j]>aver)
num++;
cout<<"aver= "<<aver<<endl;
cout<<"num= "<<num<<endl;
system("pause");
return 0;
}

编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习2的更多相关文章

  1. 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习9

    #include <iostream> #include <fstream> #include <cstdlib> #include <string> ...

  2. 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习8

    #include <iostream> #include <fstream> #include <cstdlib> const int SIZE=20; using ...

  3. 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习7

    #include <iostream> #include <string> #include <cctype> using namespace std; int m ...

  4. 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习6

    #include <iostream> #include <string> using namespace std; const int MSIZE=100; struct j ...

  5. 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习5

    #include <iostream> using namespace std; const double N1=35000; const int N2=15000; const int ...

  6. 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习4

    #include <iostream> using namespace std; const int strsize=30; const int BOPSIZE=5; void showm ...

  7. 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习3

    #include <iostream> using namespace std; void showmenu(void) { cout<<"Please enter ...

  8. 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习1

    #include <iostream>#include <cctype>using namespace std;int main(){ char ch; while((ch=c ...

  9. 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第5章编程练习9

    #include <iostream>using namespace std;int main(){ int num; cout<<"Enter number of ...

随机推荐

  1. 集合的遍历以及在Spring中的注入

    (一)遍历 list:foreach循环 set:foreach循环 map:先用set集合得到所有key值,然后循环key得到所有vale Map<String,String> map ...

  2. 机器学习 - 损失计算-softmax_cross_entropy_with_logits

    tf.nn.softmax_cross_entropy_with_logits(logits, labels, name=None) 第一个参数logits:就是神经网络最后一层的输出 第二个参数la ...

  3. 1.4分布式-通讯协议TCP/IP

    服务器和浏览器的通讯依靠http协议,今天就来分析一下http协议的具体内容以及https的加密过程.除了这些协议,为了增加服务器和浏览器交互的可拓展性,也出现了rest风格的请求方式,方便调用接口. ...

  4. openJDK之如何下载各个版本的openJDK源码

    如果我们需要阅读openJDK的源码,那么需要下载,那么该去哪下载呢? 现在JDK已经发展到版本10了,11已经处于计划中,如果需要特定版本的openJDK,它们的下载链接在哪呢? 1.openJDK ...

  5. PyQt5开发环境搭建

    一 写在开头1.1 本节内容开个新坑—“PyQt5系列”,慢慢填.本文主要内容为PyQt5开发环境的搭建. 注意:PyQt 5.10以上的版本在Python 3.6中有BUG,PyQt 5.10版本是 ...

  6. [物理学与PDEs]第4章习题3 一维理想反应流体力学方程组的数学结构

    证明: Euler 坐标系下的一维反应流体力学方程组 (3. 10)-(3. 13) 也是一个一阶拟线性双曲型方程组. 证明: 由 (3. 10), (3. 12), (3. 13) 知 $$\bex ...

  7. Element ui select同时获取value和label的值

    代码如下: <el-form-item v-if="isMD" label="业务员名称"> <el-select v-model=" ...

  8. Silverlight Visifire控件应用去除图标的水印

    首先,新建一个类,继承自Chart,重写LoadWatermark方法. 再创建图表实例的时候就不能new Chart实例了,直接使用MyCharts. 使用去除水印之前的图片: 使用去除水印之后的图 ...

  9. java获取上个星期第一天和最后一天

    package com.goldcn.jzgmanageplat.b2b.controller; import java.text.SimpleDateFormat;import java.util. ...

  10. Why Random Initialization in Neural Network?