Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using System.Collections.Generic;
- public class Program
- {
- public static void Main()
- {
- double bitcoins = double.Parse(Console.ReadLine());
- double etereums = double.Parse(Console.ReadLine());
- double litecoins = 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 type = Console.ReadLine();
- double operationMoney = 0;
- if (valuta == "Bitcoin")
- {
- operationMoney = actives * bitcoins;
- }
- else if (valuta == "Etereum")
- {
- operationMoney = actives * etereums;
- }
- else if (valuta == "Litecoin")
- {
- operationMoney = actives * litecoins;
- }
- if (type == "Sell")
- {
- money -= operationMoney;
- }
- else if (type == "Buy")
- {
- money += operationMoney;
- }
- commision += operationMoney * coeff;
- }
- money -= commision;
- Console.WriteLine("{0:F16}", money);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement