← 返回 stripe 的题目列表Parse a CSV and output fees by payment status in a specified format
类型:online_judge
You are given a CSV file content. Parse the CSV and output fee/amount information based on the payment status, with the output formatting matching the provided example exactly.
Task
Read a CSV text from stdin (header row followed by data rows).
Parse each record and extract the payment status field and the fee/amount field.
Process records by payment status and produce the required output (e.g., filter and print, or group and aggregate; follow the example).
Input
A CSV text (header + rows) from standard input.
Output
The output must match the example output exactly (field order, delimiters, casing, spaces, and newlines).
Constraints / Edge Cases
The CSV may contain empty lines.
Fields may contain extra whitespace and should be trimmed.
Quoted fields may appear (including commas inside quotes).
Numeric fields may require specific formatting (e.g., fixed decimals).
Invalid/malformed rows or missing fields should be handled as required by the prompt (ignore/error/default; follow the example).
Example
(Refer to the original prompt's example; omitted here.)
Example
Input
payment_status,fee
PAID,10
UNPAID,5
PAID,2.5
Output
PAID: 12.50
UNPAID: 5.00