Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace AccountBalance
- {
- class Program
- {
- static void Main(string[] args)
- {
- double balance = 0.0;
- string money = Console.ReadLine();
- while(money != "NoMoreMoney")
- {
- money = double.Parse(money);
- if (money < 0)
- {
- Console.WriteLine("InvalidOperation!");
- break;
- }
- balance += money;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement