← 返回 coinbase 的题目列表Banking Account Operations
类型:online_judge
Implement a simple banking account system that supports the following operations: create account, deposit, and transfer. Each account should have a unique identifier and an initial balance. The operations should result in outputs formatted in a specific way.
Operations
Create account
Input: A unique account identifier and an initial balance.
Output: A message confirming account creation.
Deposit
Input: Account identifier and deposit amount.
Output: The current balance of the account.
Transfer
Input: Two account identifiers (source account and target account) and transfer amount.
Output: The current balances of both accounts.
Example
Input:
createAccount A 1000
deposit A 500
transfer A B 200
Output:
Account A created with balance 1000
Current balance of A: 1500
Balance of A: 1300, B: 200
Constraints
The number of accounts and operations do not exceed 1000.
All amounts are non-negative integers.
Example
Input
createAccount A 1000
deposit A 500
transfer A B 200