博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
hdu 4176
阅读量:5316 次
发布时间:2019-06-14

本文共 2138 字,大约阅读时间需要 7 分钟。

Class Statistics

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)

Total Submission(s): 233    Accepted Submission(s): 153

Problem Description
The new principal of Woop Woop Public plans to meet the teaching team to discuss the performance of the classes/teachers and, being a bean counting fundamentalist, he wants to arm himself with some statistics for the meetings.
Your task is to write a program that reads the pupils' marks in each class and generates performance reports for the principal prior to the meetings.
 

 

Input
The input starts with an integer K (1 <= K <= 100) indicating the number of classes on a line by itself. Each of the following K lines gives a class's data, which starts with an integer N (2 <= N <= 50) indicating the number of pupils in the class. The number of pupils is followed by their marks, given as integers, in the range of zero to one hundred, separated by single spaces.
 

 

Output
The report for each class consists of two lines.
The first line consists of the sentence: "Class X", where X indicates the class number starting with the value of one.
The second line reports the maximum class mark, minimum class mark and the largest difference between consecutive marks (when sorted in non-decreasing order) in the class using the formats shown in the sample below.
 

 

Sample Input
2 5 30 25 76 23 78 6 25 50 70 99 70 90
 

 

Sample Output
Class 1 Max 78, Min 23, Largest gap 46 Class 2 Max 99, Min 25, Largest gap 25
 

 

Source
 

 

Recommend
lcy   |   We have carefully selected several similar problems for you:          
 
#include
#include
#include
#include
#include
using namespace std;int a[500];int main(){ int t; scanf("%d",&t); int cnt=0; while(t--){ int n; cnt++; memset(a,0,sizeof(a)); scanf("%d",&n); int temp=-1,temp1; for(int i=0;i
temp) temp=temp1; } printf("Class %d\n",cnt); printf("Max %d, Min %d, Largest gap %d\n",a[n-1],a[0],temp); } return 0;}

 

转载于:https://www.cnblogs.com/13224ACMer/p/4728953.html

你可能感兴趣的文章
java Map常用方法封装
查看>>
欧几里德与扩展欧几里德算法
查看>>
python中深浅拷贝
查看>>
python中numpy.r_和numpy.c_
查看>>
MySQL关于sql_mode的修改(timestamp的默认值不正确)
查看>>
laravel如何打印orm封装的sql语句
查看>>
大道至简阅读笔记02
查看>>
如何让在panel里的子窗体随panel的大小改变而变化?(转)
查看>>
Concurrent包总结——线程安全的集合操作
查看>>
WPF简单模拟QQ登录背景动画
查看>>
Where to go from here
查看>>
Bitmap和Drawable相互转换方法
查看>>
bzoj 2038 小Z的袜子
查看>>
egret3D与2D混合开发,画布尺寸不一致的问题
查看>>
自定义线程池
查看>>
freebsd 实现 tab 命令 补全 命令 提示
查看>>
numpy调试
查看>>
struts1和struts2的区别
查看>>
函数之匿名函数
查看>>
shell习题第16题:查用户
查看>>