Skip to content

Latest commit

 

History

History
23 lines (19 loc) · 790 Bytes

problem1_sum_of_marks.md

File metadata and controls

23 lines (19 loc) · 790 Bytes

A town high school keeps the marks of physics, chemistry, mathematics in the following format.

{Name of student} P{mark of physics} C{mark of physics} M{mark of mathematics}

Sample data looks like
"Ram P10 C20 M20", (total 50)
"Jam P8 C10 M12", (total 30)
"Pam P10 C30 M10", (total 50)
"Sam P12 C28 M20", (total 60)

Find the Sum of total marks (where total = marks of physics + chemistry + maths) obtained by the top 3 students in the below list?
(for the above sample result is 60 + 50 + 50 = 160)

------------ input ------------
"Roku P69 C57 M91"
"Rami P95 C61 M65"
"Piku P95 C83 M96"
"Aman P50 C75 M40"
"chiku P79 C81 M53"
"moku P56 C87 M77"
"Chacha P85 C64 M55"
"Rama P100 C73 M79"