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

Function main

codes/cpp/Code_3_06_1.cpp:7–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5int N, A[200009];
6
7int main() {
8 // ���́i���Ƃ��� N=5, A[1]=3, A[2]=1, A[3]=4, A[4]=1, A[5]=5 ����͂����Ƃ���j
9 cin >> N;
10 for (int i = 1; i <= N; i++) cin >> A[i];
11
12 // �\�[�g�i���J��� [1, N+1) ���\�[�g����̂ŁA������ A+1, A+N+1 ���w�肵�Ă���j
13 // sort �֐��ɂ��A�z��̒��g�� [3,1,4,1,5] ���� [1,1,3,4,5] �ɏ�����������
14 sort(A + 1, A + N + 1);
15
16 // �o�́i1, 1, 3, 4, 5 �̏��ɏo�͂����j
17 for (int i = 1; i <= N; i++) cout << A[i] << endl;
18 return 0;
19}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected