#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. openstack项目【day23】:云计算介绍(一)

    本节内容 为何选择云计算/云计算之前遇到的问题 什么是云计算 云服务模式 云应用形式 传统应用与云感知应用 一:为何选择云计算/云计算之前遇到的问题 一.有效解决硬件单点故障问题 单点故障是指某个硬件 ...

  2. Run Configurations(Debug Configurations)->Arguments里填写program arguments和VM arguments

    如图: 1.program arguments存储在String[] args里 2.VM arguments设置的是虚拟机的属性,是传给java虚拟机的.KV形式存储的,是可以通过System.ge ...

  3. 抓包工具Charles基本用法

    我们在进行B/S架构的Web项目开发时,在前端页面与后台交互的调试的时候,通常使用在JSP中加入“debugger;”断点,然后使用浏览器的F12开发者工具来查看可能出错的地方的数据.或者使用Http ...

  4. CSS难点 为什么height设置100%会失效,分栏目等高布局(高度自适用布局)的实现方案

    前言 相信在平时写CSS的时候大家都或多或少遇见过设置了height为百分比的时候发现不起作用.今天我们就来一探究竟 原因:父元素未设置具体高度,子元素设置height:100%是无效的. 现象以及方 ...

  5. Codeforces Round #545 (Div. 2) C. Skyscrapers 离散化+贪心

    题目链接 给你一个n∗m的矩阵res,让你输出一个n∗m的矩阵a,这个矩阵满足:给你一个n*m的矩阵res,让你输出一个n*m的矩阵a,这个矩阵满足:给你一个n∗m的矩阵res,让你输出一个n∗m的矩 ...

  6. Tupper自我指涉公式生成器

  7. VJTools

    https://mp.weixin.qq.com/s/cwU2rLOuwock048rKBz3ew

  8. filebeat_config

    Filebeat Prospector filebeat.prospectors: - input_type: log paths: - /var/log/apache/httpd-*.log doc ...

  9. jupyter notebooks 中键盘快捷键

    键盘快捷键——节省时间且更有生产力! 快捷方式是 Jupyter Notebooks 最大的优势之一.当你想运行任意代码块时,只需要按 Ctrl+Enter 就行了.Jupyter Notebooks ...

  10. Java设计模式迭代器

    定义:提供一种方法,顺序访问一个集合对象中的各个元素,而又不暴露该对象的内部表示. 类型:行为型 适用场景: 访问一个集合对象的内容而无需暴露它的内部表示 为遍历不同的集合结构提供一个统一的接口 优点 ...