Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _05.AccountBalance
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- string input = Console.ReadLine();
- double totalSum = 0;
- while (input != "NoMoreMoney")
- {
- double moneyIncrease = double.Parse(input);
- if (moneyIncrease < 0)
- {
- Console.WriteLine("Invalid operation!");
- break;
- }
- Console.WriteLine($"Increase: {moneyIncrease:f2}");
- totalSum += moneyIncrease;
- input = Console.ReadLine();
- }
- Console.WriteLine($"Total: {totalSum:f2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement