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 ...
随机推荐
- Spring Cloud与Spring Boot的关系
1.Spring Cloud是一个工具集:Spring Cloud是在Spring Boot的基础上构建的,用于简化分布式系统构建的工具集:使架构师在创建和发布微服务时极为便捷和有效. Sp ...
- 【目录】Python模块学习系列
目录:Python模块学习笔记 1.Python模块学习 - Paramiko - 主机管理 2.Python模块学习 - Fileinput - 读取文件 3.Python模块学习 - Confi ...
- 從 kernel source code 查出 版本號碼
kernel/Makefile 1 VERSION = 4 2 PATCHLEVEL = 4 3 SUBLEVEL = 21 4 EXTRAVERSION = 5 NAME = Blurry Fish ...
- f1 f12热键关闭
fn+f2进入bios系统——>找到configuration——>Hotkey Mode——>enter——>选择disable——>fn+f10保存
- [收集]关于MSSQL数据库的一些查询
sqlserver快速查找所有存储过程中是否包含某字符 --将XXXX替换成你要查找的内容 select name from sysobjects o, syscomments s where o.i ...
- ado中dispose和close的区别,摘自网络
Close() and Dispose() are basically the same thing on an ADO.NET connection object for providers shi ...
- ES6 module语法加载 import export
export:暴露,就是把接口暴露出去 import:引入,跟字面意思一样,引入接口 export {} export function demo(){} export var demo1; 这上面的 ...
- 《逐梦旅程 WINDOWS游戏编程之从零开始》笔记3——输入消息处理,物理建模与粒子系统初步
第7章 Windows游戏输入消息处理 1. 键盘消息处理 之前提到的窗口过程函数有两参数与消息输出有关——wParam和llParam LRESULT CALLBACK WindowProc( _I ...
- linux下输入密码不回显
这几天在做一个登陆的程序,需要将输入的密码屏蔽掉,自己百度,找到了两种方法,先贴下第一种方法, #include<stdio.h> #include<unistd.h> int ...
- Java学习笔记(十二)——eclipse和SVN配置,导入SVN服务器项目
[前面的话] 北京的天气外加自己的不小心终于病了,在病的过程中,感觉身体好着真好,可以学习,可以吃好吃的,可以去运动,这一病了,干什么都感觉没有力气,身体好着真好. 这个文章的背景是:领导把项目最开始 ...