编程介的小学生 2017-08-18 03:09 采纳率: 20.5%
浏览 663
已采纳

disney

Problem Description
A new machine was introduced into disney world. Every day, there is a long queue because of its function. Everyone can input their score or update their score. If you want to know the maximum or the average, it can help you, too.What's more, if you don't want that your score be saw, you can delete your register from it. Since the new machine was introduced, everyone be more hard.

Input
The input contain only one case.
There are kinds of format that show different functions:
(1)NEW name score(you can use it to input your score or update your score)
name: the name of current user.The length of the name is no longer than 8.
score: the score of current user.(0<score<=100)
(2)AVERAGE(you can use is to get the average score)
(3)MAX(you can use is to get the maximal score and whose score is the maximum.)
(4)DELETE name:delete the name and its record too.
name: the name of current user.The length of the name is no longer than 8.
(5)QUIT(this command is used to turn off the machine,is the end of the input)

Output
(1)For "NEW name score" , if it's there is a lack of record of the user. print "A new record".else print "update succeed".
(2)For "AVERAGE" , you should print the average score rounded to two digits after the decimal point.if there are none record in the machine,the average is 0.00;
(3)For "MAX" , you should first print the maximal score and the number that whose score is the maximum, then print all of their names Lexicographicly, and each name owns a single line. If there isn't any record in the machine,just output"0 0".
(4)For "DELETE name" , if there is a lack of record of the user. print "no such record".else print "delete succeed".

The population of disney is no more than 100.

Sample Input
NEW mickey 99
NEW mini 88
MAX
AVERAGE
DELETE winnie
QUIT

Sample Output
A new record
A new record
99 1
mickey
93.50
no such record

  • 写回答

2条回答 默认 最新

  • threenewbee 2017-08-18 15:41
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效