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

Function main

codes/cpp/Code_3_03_1.cpp:7–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5int Answer = 0;
6
7int main() {
8 // ����
9 cin >> N;
10 for (int i = 1; i <= N; i++) cin >> A[i];
11
12 // 5 �‚̃J�[�h�̔ԍ� (i, j, k, l, m) ��S�T��
13 for (int i = 1; i <= N; i++) {
14 for (int j = i + 1; j <= N; j++) {
15 for (int k = j + 1; k <= N; k++) {
16 for (int l = k + 1; l <= N; l++) {
17 for (int m = l + 1; m <= N; m++) {
18 if (A[i] + A[j] + A[k] + A[l] + A[m] == 1000) Answer += 1;
19 }
20 }
21 }
22 }
23 }
24
25 // �����̏o��
26 cout << Answer << endl;
27 return 0;
28}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected