need help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ryanfdo
    New Member
    • Feb 2008
    • 1

    need help

    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
  • Ganon11
    Recognized Expert Specialist
    • Oct 2006
    • 3651

    #2
    The experts on this site are more than happy to help you with your problems but they cannot do your assignment/program for you. Attempt the assignment/program yourself first and post questions regarding any difficulties you have or about a particular function of the code that you don't know how to achieve.

    Please read the Posting Guidelines and particularly the Coursework Posting Guidelines.

    Then when you are ready post a new question in this thread.

    MODERATOR

    Comment

    Working...