P122.42
来源:互联网 发布:怎样查电脑mac地址 编辑:程序博客网 时间:2024/04/29 17:40
<span style="font-size: 18px; font-weight: bold; font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">/* Note:Your choice is C IDE */ </span>#include "stdio.h"
int Count(double a[], int n)
{
int i,s=0;
double ave,sum=0;
for(i=0;i<n;i++)
{
sum=sum+a[i];
}
ave=sum/n;
printf("该数组平均值为:%.2f\n",ave);
for(i=0;i<n;i++)
{
if (a[i]>=ave)
s++;
}
return s;
}
void main()
{
int s;
double a[10]={1.0,1.2,1.4,1.6,1.8,2.0,2.2,2.4,2.6,2.8};
s=Count(a ,10);
printf("超过平均值的有 %d 个!",s);
}
0 0
- P122.42
- p122.10
- P122 6
- P122 10
- P122 14
- P122 15
- P122 15
- P122 16
- P122 17
- P122 21
- P122 28
- P122 20
- p122 6
- p122 10
- p122.15.
- p122 14
- p122 15
- p122 16
- JAVA基础——IO流
- 欢迎使用CSDN-markdown编辑器
- Mac OS安装Apache、Tomcat、Nginx、PHP、MySQL、终端配色
- Servlet/JSP简介
- 解决百度定位获取position为空的困惑
- P122.42
- [总结] 网络流学习笔记
- cf-289B
- 黑马程序员——C语言基础——文件读写实战
- 实现医生工作站的疾病档案功能的代码(十五)
- CentOS下面安装Tomcat并设置为自启动服务
- P123.36
- IOS 运行时(runtime)机制
- iOS Plist文件的创建