标签:
判分标准啥的
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
#include"iostream"#include"stdlib.h"#include"stdio.h"#include<iomanip>#include<cmath>using namespace std;int max(int a, int b, int c){ if (a >=b) { if (a >= c) return a; else { return c; } } else { if (b >= c) return b; else { return c; } }}int main( ){ int full_mark, tolerence, G1, G2, G3, Gj; double resu; while (cin >> full_mark >> tolerence >> G1 >> G2 >> G3 >> Gj) { if (abs(G1 - G2) <= tolerence) resu =(double) (G1 + G2) / 2.0; else if (abs(G3 - G1) > tolerence && abs(G3 - G2) <= tolerence) { resu = (double)(G3 + G2) / 2.0; } else if (abs(G3 - G2) > tolerence && abs(G3 - G1) <= tolerence) { resu = (double)(G3 + G1) / 2.0; } else if (abs(G3 - G1) <= tolerence && abs(G3 - G2) <= tolerence) resu = max(G1, G2, G3)+1.0-1.0; else { resu = (double)Gj + 1.0 - 1.0; } printf("%.1lf\n", resu); } return 0;} |
标签:
原文地址:http://www.cnblogs.com/chendashennihao/p/5349934.html