Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Account_Balance
- {
- class Program
- {
- static void Main(string[] args)
- {
- int entries = int.Parse(Console.ReadLine());
- int counter = 1;
- double currentSum = 0;
- while (counter <= entries)
- {
- double income = double.Parse(Console.ReadLine());
- if (income < 0)
- {
- Console.WriteLine("Invalid operation!");
- break;
- }
- else
- {
- currentSum += income;
- Console.WriteLine($"Increase: {income:f2}");
- }
- counter++;
- }
- Console.WriteLine($"Total: {currentSum}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement