首页 > 试题广场 >

Grading

[编程题]Grading
  • 热度指数:9882 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 64M,其他语言128M
  • 算法知识视频讲解
    Grading hundreds of thousands of Graduate Entrance Exams is a hard work. It is even harder to design a process to make the results as fair as possible. One way is to assign each exam problem to 3 independent experts. If they do not agree to each other, a judge is invited to make the final decision. Now you are asked to write a program to help this process.     For each problem, there is a full-mark P and a tolerance T(<P) given. The grading rules are:     • A problem will first be assigned to 2 experts, to obtain G1 and G2. If the difference is within the tolerance, that is, if |G1 - G2| ≤ T, this problem's grade will be the average of G1 and G2.     • If the difference exceeds T, the 3rd expert will give G3.     • If G3 is within the tolerance with either G1 or G2, but NOT both, then this problem's grade will be the average of G3 and the closest grade.     • If G3 is within the tolerance with both G1 and G2, then this problem's grade will be the maximum of the three grades.     • If G3 is within the tolerance with neither G1 nor G2, a judge will give the final grade GJ.

输入描述:
    Each input file may contain more than one test case.
    Each case occupies a line containing six positive integers: P, T, G1, G2, G3, and GJ, as described in the problem. It is guaranteed that all the grades are valid, that is, in the interval [0, P].


输出描述:
    For each test case you should output the final grade of the problem in a line. The answer must be accurate to 1 decimal place.
示例1

输入

20 2 15 13 10 18

输出

14.0
头像 渺小小螃蟹
发表于 2021-05-08 21:10:38
#include<stdio.h> #include<math.h> int main() { int P,T,G1,G2,G3,GJ,a,b,c; float grade; while(scanf("%d %d %d %d %d %d",& 展开全文
头像 FredaLiu
发表于 2020-03-06 11:03:34
这个题主要就是读懂题目,考察英语水平,其实并不难理解,但是需要耐心,所以这里希望大家能够硬着头皮自己读题,我就不进行翻译了。这里领一个考察点就是保留一位小数。我将变量设为了float型,在printf中有一个用法可以设置输出数字的形式。即printf("%.1f",x); #include < 展开全文
头像 chong_0428
发表于 2024-03-23 23:26:38
def m(a, b): if a > b: return a else: return b def m3(a, b, c): s = [] s.append(a) s.append(b) s.append(c) 展开全文
头像 ysong想养只修狗
发表于 2023-04-20 17:04:59
#include <cmath> #include <cstdio> #include <iostream> #include <algorithm> using namespace std; void grade(int T, int G1, in 展开全文
头像 JXH001
发表于 2024-02-13 12:14:02
#include <iostream> using namespace std; double max(int a, int b, int c) { int temp = 0; if (a > b) { temp = a; } else te 展开全文
头像 lck_lu
发表于 2024-01-16 09:01:49
#include "cstdio" #include "iostream" #include "cmath" using namespace std; int main() { double P, T, G1, G2, G3, 展开全文
头像 lyw菌
发表于 2023-03-26 19:47:15
//送分题,就是麻烦一点 #include "stdio.h" #include "math.h" #include "algorithm" using namespace std; int main(){ double F,T,G1,G2,G3,GJ;//full-mark,tolera 展开全文
头像 地沟油油烟机
发表于 2024-02-18 21:43:34
#include<iostream> #include<cstdio> using namespace std; int max(int i,int j,int k){ if(i>j) return (i>k)?i:k; els 展开全文
头像 rainman_
发表于 2023-03-14 14:42:49
#include <iostream> #include <iomanip> using namespace std; double absminus(double a, double b) { if (a >= b) return a - b 展开全文
头像 牛客160933353号
发表于 2024-03-02 19:14:33
#include <algorithm> #include <bits/stdc++.h> #include <complex> using namespace std; int main() { int a, b,x,y,z,j; while 展开全文

问题信息

难度:
44条回答 4144浏览

热门推荐

通过挑战的用户

查看代码