Asked by Anonymous
read the names and age of 10 people and print the name of the oldest person.assume that there are no person of the same age.data is supplied in the following form:name,age,name,age
Answers
Answered by
oobleck
maxage = 0
for i=1..10
read name,age
if age > maxage {
maxage = age
maxname = name
}
next i
print maxname
for i=1..10
read name,age
if age > maxage {
maxage = age
maxname = name
}
next i
print maxname
There are no AI answers yet. The ability to request AI answers is coming soon!
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.