Implement a command-line program /app/topk that reads a UTF-8 text file where each line is a floating-point…
Implement a command-line program /app/topk that reads a UTF-8 text file where each line is a floating-point…: a task in TermGrade Environments: 1,004 executable Linux tasks (Harbor dataset). Output contract: - Exactly K lines if the file contains at least K valid numbers. - Fewer than K lines if…
The task
Output contract: - Exactly K lines if the file contains at least K valid numbers. - Fewer than K lines if the file contains fewer valid numbers (output all valid numbers in descending order). - Each output line is the number formatted with exactly one decimal digit after the decimal point, no exceptions. - Numbers…
Part of ai-and/termgrade-environments.