题目描述

(Credit Limits) Develop a C++ program that will determine whether a department-store customer has exceeded the credit limit on a charge account. For each customer, the following facts are available:
a) Account number (an integer)
b) Balance at the beginning of the month
c) Total of all items charged by this customer this month
d) Total of all credits applied to this customer's account this month
e) Allowed credit limit
The program should use a while statement to input each of these facts, calculate the new balance (= beginning balance + charges – credits) and determine whether the new balance exceeds the customer’s credit limit. For those customers whose credit limit is exceeded, the program should display the customer’s account number, credit limit, new balance and the message “Credit Limit Exceeded.”


输入格式

The input consists of n (0<n<100) lines.
Each line consists of int_A(Account number>0), float_B(Balance), float_C(charges), float_D(credits),float_E(credit limit).
The last line of input consists of int(-1).


输出格式

The decimal precision of output is 2.


样例数据

输入

100 5394.78 1000 500 5500
200 1000 123.45 321 1500
-1

输出

New balance is 5894.78
Account: 100
Credit limit: 5500.00
Credit Limit Exceeded.
New balance is 802.45

备注


操作

评测记录

优秀代码

信息

时间限制: 1s
内存限制: 128MB
评测模式: Normal

题解