11-05-2010, 22:25
|
|
|
חבר מתאריך: 03.07.07
הודעות: 13
|
|
בעיית אחוזים
שלום, יש לי איזה בעיה שאני צריך לפתור ומשום מה אני לא מצליח להגיע לתשובה הנכונה
השאלה היא לא ממש תכנותית אלא יותר שאלת חשיבה אבל זה נראה לי הפורום המתאים ביותר
קוד:
EXAMPLE:
Consider these assignment scores:
* 41 points out of 42
* 22 out of 64
* 2 out of 26
* 11 out of 44
* 24 out of 27
* 26 out of 70
* 4 out of 30
The grade percentage when dropping zero assignments is:
(41+22+2+11+24+26+4) / (42+64+26+44+27+70+30) = 42.9%
But, you could improve that percentage, by choosing 3 scores to drop.
What is the maximum percentage possible, by dropping 3 scores?
INPUT:
Input to your program is:
* The number of assignments. (This is at least 4, and at most 30.)
* The student's scores, one at a time, for each of the assignments.
(Scores are at least 0, and at most the maximum.)
* The maximum scores, one at a time, for each assignment.
(These are at least 1, and at most 100.)
OUTPUT:
* The best possible final assignment percentage, from dropping 3 scores.
תודה לכל המנסים
נערך לאחרונה ע"י אביב.ח בתאריך 11-05-2010 בשעה 22:28.
|