Dear members,
please be kind to post the code for this program
Crimes are frequent in a planet far away from earth. So, they have decided to form a police and they want the oldest five persons to be the police officers, and because there are many people in this village they want you to write a program to find the oldest five.
⢠No two persons are of the same age
⢠They can live up to 10000 years
Input
1. First line contains N (5 <= N <= 1000).
2. Each of the next N lines contains Ai which is the age of the ith person. The ID number of the ith person is also āiā.
Output
1. First five lines should contain the ID numbers of the five persons selected, in decreasing order of age.
Example Input
10
10
3
20
100
50
11
15
25
60
75
Example Output
4
10
9
5
8
please be kind to post the code for this program
Crimes are frequent in a planet far away from earth. So, they have decided to form a police and they want the oldest five persons to be the police officers, and because there are many people in this village they want you to write a program to find the oldest five.
⢠No two persons are of the same age
⢠They can live up to 10000 years
Input
1. First line contains N (5 <= N <= 1000).
2. Each of the next N lines contains Ai which is the age of the ith person. The ID number of the ith person is also āiā.
Output
1. First five lines should contain the ID numbers of the five persons selected, in decreasing order of age.
Example Input
10
10
3
20
100
50
11
15
25
60
75
Example Output
4
10
9
5
8
Comment