Supermarket

Write a program that reads a sequence of expenses made by customers of a
supermarket, and finds out whether anyone has paid in cash over 1000
euros.

Customer expenses are formatted in one line per customer. Each line
consists of a sequence of floats (representing the prices of bought
items) and ends with either the word card (if paid by credit card) or
cash.

There is at least one customer line.

All customer lines include at least one item price.

The output must be either “Somebody paid over 1000 euros in cash!” if
there is at least one customer line where the sum of all the prices of
items bought adds to over 1000 and the line ends with the word cash;
otherwise, the output must be “Nobody paid over 1000 euros in cash.”

Input

A sequence of customer expenses, in a separate line for each customer.
Each line is a sequence of real numbers followed by either the word card
or cash.

Output

Either the sentence “Somebody paid over 1000 euros in cash!” or “Nobody
paid over 1000 euros in cash.”

Problem information

Author: ProAl

Generation: 2026-01-25T17:42:36.759Z

© Jutge.org, 2006–2026.
https://jutge.org
