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 _06.Account_Balance
- {
- class Program
- {
- static void Main(string[] args)
- {
- int N = int.Parse(Console.ReadLine());
- int S = 0;
- double B = 0.0;
- while (S < N)
- {
- double T = double.Parse(Console.ReadLine());
- if (T < 0)
- {
- Console.WriteLine("Invalid operation!");
- break;
- }
- else
- {
- B += T;
- Console.WriteLine($"Increase: {T:F2}");
- }
- S++;
- }
- Console.WriteLine($"Total: {B:F2}");
- }
- }
- }
- /*
- --- Var Legend
- N = Number
- S = Sumer
- B = Balance
- T = Total
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement