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