Problem H: 零起点学算法87——打印所有低于平均分的分数
#include<stdio.h>
int main(){
int n,a[],b[];
while(scanf("%d",&n)!=EOF){
int s=;
for(int i=;i<n;i++){
scanf("%d",&a[i]);
s+=a[i];
}
float ave=(float)s/n;
int j=;
for(int i=;i<n;i++){
if(a[i]<ave){
b[j]=a[i];
j++;
}
}
if(j==)
printf("\n");
else{
for(int i=;i<j-;i++){
printf("%d ",b[i]);
}
printf("%d\n",b[j-]);
}
}
return ;
}
Problem H: 零起点学算法87——打印所有低于平均分的分数的更多相关文章
- Problem H: 零起点学算法109——单数变复数
#include <stdio.h> #include<string.h> int main(void) { int n; ]; scanf("%d",&a ...
- Problem H: 零起点学算法103——查找最大元素
#include<stdio.h> #include<string.h> int main() { ]; while(gets(a)!=NULL) { ]; ;a[i]!='\ ...
- Problem H: 零起点学算法28——参加程序设计竞赛
#include<stdio.h> int main() { int a,b; while(scanf("%d %d",&a,&b)!=EOF) ||b ...
- Problem G: 零起点学算法106——首字母变大写
#include<stdio.h> #include<string.h> int main(void) { ]; int i,k; while(gets(a)!=NULL) { ...
- Problem D: 零起点学算法95——弓型矩阵
#include<stdio.h> #include<string.h> int main() { ][]; while(scanf("%d%d",& ...
- Problem F: 零起点学算法42——多组测试数据输出II
#include<stdio.h> int main() { ; while(scanf("%d%d%d",&a,&b,&c)!=EOF) { ...
- Problem E: 零起点学算法34——3n+1问题
#include<stdio.h> #include<math.h> int main() { int n; n<=pow(,); ; scanf("%d&qu ...
- Problem K: 零起点学算法107——统计元音
#include<stdio.h> int main() { int n; ]; while(scanf("%d%*c",&n)!=EOF) { while(n ...
- Problem J: 零起点学算法105——C语言合法标识符
#include<stdio.h> #include<ctype.h>//调用isalpha函数 int main() { int n; ]; while(scanf(&quo ...
随机推荐
- 【Sqlite3】sqlite_sequence表(转)
sqlite_sequence表也是SQLite的系统表.该表用来保存其他表的RowID的最大值.数据库被创建时,sqlite_sequence表会被自动创建.该表包括两列.第一列为name,用来存储 ...
- android 与JS之间的交互
在页面布局很复杂并且是动态的时候,android本身的控件就变得不是那么地灵活了,只有借助于网页的强大布局能力才能实现,但是在操作html页面的同时也需要与android其它的组件存在交互,比如说 在 ...
- mybatis开启字段自动映射为java驼峰命名规则
<settings> <setting name="mapUnderscoreToCamelCase" value="true"/> & ...
- expose a port on a living Docker container
if you have a container that with something running on its port 8000, you can run wget http://contai ...
- input标签获取焦点时文本框内提示信息清空背景颜色发生变化
<input type="text" id="username" onfocus="myFocus(this,'#f4eaf1')" ...
- jQuery实现,动态自动定位弹窗。JS分页,Ajax请求
工作中碰到一个问题,一个页面中碰到多个地方需要弹窗数据. 网上找了一圈,没有找到合适的,所以自己写了一个. 兼容IE7+,chrome.其它未测试. 需求:点击任意的输入框(也可其它元素,代码中有注释 ...
- php上传文件常见错误
今天在文件上传过程中遇到的文件上传不过去,和网页报错,最后经查看总结有以下几个方面 上传文件错误码 error=0 正常上传 error=1 上传的大小超过了input[type=file]的文件上传 ...
- Django内置信号
阅读目录(Content) Django中内置的signal 自定义信号 1.定义信号 2.注册信号 3.触发信号 回到顶部(go to top) Django中内置的signal Django中提供 ...
- Python中的PIL
转自:http://blog.csdn.net/yockie/article/details/8498301 介绍 把Python的基础知识学习后,尝试一下如何安装.加载.使用非标准库,选择了图像处理 ...
- JMeter------ _time 函数的使用(时间戳、当前时间)
操作步骤: 1.通过函数助手,生成一个_time 函数: 2.如果参数为时间戳,那公式为: ${__time(,)} : 默认该公式精确到毫秒级别, 13位数 ${__time(/1000,)} ...