Again Mr.Judge being unsatisfied
You will receive course name and student name, until you receive the command "end". Check if such course already exists, and if not - add the course. Register the user into the course. When you do receive the command "end", print the courses with their names and total registered users, ordered by the count of registered users in descending order. For each contest print registered users ordered by name in ascending order.
Input
- Until you receive "end", the input come in the format: "{courseName} : {studentName}"
- The product data is always delimited by " : "
Output
- Print information about each course, following the format:
"{courseName}: {registeredStudents}" - Print information about each student, following the format:
"-- {studentName}"
Examples
Input |
Output |
Programming Fundamentals : John Smith Programming Fundamentals : Linda Johnson JS Core : Will Wilson Java Advanced : Harrison White end |
Programming Fundamentals: 2 -- John Smith -- Linda Johnson JS Core: 1 -- Will Wilson Java Advanced: 1 -- Harrison White |
Algorithms : Jay Moore Programming Basics : Martin Taylor Python Fundamentals : John Anderson Python Fundamentals : Andrew Robinson Algorithms : Bob Jackson Python Fundamentals : Clark Lewis end |
Python Fundamentals: 3 -- Andrew Robinson -- Clark Lewis -- John Anderson Algorithms: 2 -- Bob Jackson -- Jay Moore Programming Basics: 1 -- Martin Taylor |
на тази следна сладка задачка, 20/100 <3 -> https://pastebin.com/bsE2vmAt
ако някой би могъл да посочи грешката? :)