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 ...
随机推荐
- TensorFlow两种方式计算Cross Entropy
sparse_softmax_cross_entropy_with_logits与softmax_cross_entropy_with_logits import tensorflow as tf y ...
- 概率DP入门学习QAQ
emmmm博客很多都烂尾了...但是没空写..先写一下正在学的东西好了 概率DP这东西每次考到都不会..听题解也是一脸懵逼..所以决定学习一下这个东东..毕竟NOIP考过...比什么平衡树实在多了QA ...
- perl HTML::LinkExtor模块(1)
use LWP::Simple; use HTML::LinkExtor; $html = get("http://www.baidu.com"); $link = HTML::L ...
- Django 国内最全教程
https://code.ziqiangxuetang.com/django/django-tutorial.html
- angular数据绑定---js全局学习
<!DOCTYPE html> <html ng-app> <head> <title>Simple app</title> </he ...
- ICTPOS3.0 词性标注集
Ag 形语素 形容词性语素.形容词代码为a,语素代码g前面置以A. a 形容词 取英语形容词adjective的第1个字母. ad 副形词 直接作状语的形容词.形容词代码a和副词代码d并在一起. an ...
- EOS.IO技术学习
如今很火的项目EOS的学习,以下主要的内容是基于白皮书 参考: http://chainx.org/paper/index/index/id/20.html EOS.IO软件引入了一种新的块链架构,旨 ...
- Leetcode 之Longest Common Prefix(33)
在一组字符串中找到最长的子串.采用纵向匹配,遇到第一个不匹配的停止. string longestComPrefix(vector<string> &strs) { if (str ...
- linux命令(21):more命令
实例1:显示文件中从第3行起的内容 [root@host-172-168-80-55 home]# cat test.log aaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbb ...
- 兼容python3的SSDB客户端
SSDB.py import socket class SSDB_Response(object): def __init__(self, code='', data_or_message=None) ...