鱼C论坛

 找回密码
 立即注册
查看: 3925|回复: 0

c language关于array的题,请帮帮忙。 新手。

[复制链接]
发表于 2013-3-7 17:08:16 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

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.




小甲鱼最新课程 -> https://ilovefishc.com
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-8-7 04:02

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表