MCPcopy Create free account
hub / github.com/E869120/math-algorithm-book / main

Function main

codes/cpp/Code_3_04_1.cpp:6–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4int N, B[100009], R[100009];
5
6int main() {
7 // ����
8 cin >> N;
9 for (int i = 1; i <= N; i++) cin >> B[i];
10 for (int i = 1; i <= N; i++) cin >> R[i];
11
12 // �����̌v�Z �� �����̏o��
13 double Blue = 0.0, Red = 0.0;
14 for (int i = 1; i <= N; i++) {
15 Blue += 1.0 * B[i] / N;
16 Red += 1.0 * R[i] / N;
17 }
18 printf("%.12lf\n", Blue + Red);
19 return 0;
20}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected