|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
本帖最后由 Be_ΗaPpY 于 2013-3-7 17:18 编辑
Description:---------
Use the existing array of scoresand add a parallel array of floating-point data to track a GPA that corresponds to the score in the other array. Sort and print the set of parallel arrays first by score, highest to lowest, then by GPA, highest to lowest.
The inputs will be the number of pairs of entries (n) to be made, followed by n pairs of score & GPA.
Ex:
--
Please enter number of scores (50 or less): 6
Enter score 1 of 6: 75
Enter gpa 1 of 6: 3.25
Enter score 2 of 6: 42
Enter gpa 2 of 6: 1.55
Enter score 3 of 6: 88
Enter gpa 3 of 6: 3.75
Enter score 4 of 6: 37
Enter gpa 4 of 6: 1.75
Enter score 5 of 6: 99
Enter gpa 5 of 6: 4.0
Enter score 6 of 6: 92
Enter gpa 6 of 6: 3.3
In score order:
Score GPA
99 4.00
92 3.30
88 3.75
75 3.25
42 1.55
37 1.75
In GPA order:
GPA Score
4.00 99
3.75 88
3.30 92
3.25 75
1.75 37
1.55 42
求code.
|
|