Can you please explain the question with reference to the given test cases,and also please tell the approach to store string and int simultaneously?
Sort Game 1111111111111
Hello @gyrsh,
In the given testcase,
INPUT:
79 is the minimum salary. If an employee has salary below 79, don’t print that employee’s data.
4 is the number of employees for which input will be taken.
The next 4 lines contain the name and the salary of each employee.
OUTPUT:
Output should be in the order of decreasing salary. In case if more than one employee have same salary, their they should be sorted according to the alphabetical order of their names.
Since Bob has the maximum salary, his name and salary are printed first.
Then, although Alice and Suzy have the same salary, Alice would be alphabetically first.
Eve’s data has not been printed since here salary is below 79.
APPROACH:
Use an array of structures to store name of type string and salary of type int.
Hit like if you understood.