Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public class Program
- {
- public static void Main()
- {
- double bitcoin = double.Parse(Console.ReadLine());
- double eterum = double.Parse(Console.ReadLine());
- double litecoin = double.Parse(Console.ReadLine());
- int transactions = int.Parse(Console.ReadLine());
- double money = 0;
- double commision = 0;
- double coeff = 0.073456764216789345;
- for(int i = 0; i < transactions; i++)
- {
- int actives = int.Parse(Console.ReadLine());
- string valuta = Console.ReadLine();
- string typeV = Console.ReadLine();
- double operationMoney = 0;
- if(valuta == "bitcoin")
- {
- operationMoney = actives * bitcoin;
- }
- else if(valuta == "eterum")
- {
- operationMoney = actives * eterum;
- }
- else if(valuta == "litecoin")
- {
- operationMoney = actives * litecoin;
- }
- if(typeV == "Sell")
- {
- money -= operationMoney;
- }
- else if(typeV == "Buy")
- {
- money += operationMoney;
- }
- commision += operationMoney * coeff;
- }
- money -= commision;
- Console.WriteLine("{0:F16}", money);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment