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 Exam
- {
- class Program
- {
- static void Main(string[] args)
- {
- int votes = int.Parse(Console.ReadLine());
- double DOGE = 0.07;
- double IOTA = 1.44;
- double NEO = 28.50;
- double ESTD= 25.0;
- double totalMarket = 0;
- double dC = 0;
- double iC = 0;
- double nC = 0;
- double eC = 0;
- double dV = 0;
- double iV = 0;
- double nV = 0;
- double eV = 0;
- for (int i = 0; i < votes; i ++)
- {
- string currency = Console.ReadLine();
- double inputValue = Double.Parse(Console.ReadLine());
- if (currency == "DOGE")
- {
- dC += inputValue * DOGE;
- dV += 1;
- }
- if (currency == "IOTA")
- {
- iC += inputValue * IOTA;
- iV += 1;
- }
- if (currency == "NEO")
- {
- nC += inputValue * NEO;
- nV += 1;
- }
- if (currency == "ESTD")
- {
- eC += inputValue * ESTD;
- eV += 1;
- }
- }
- totalMarket = dC + iC + nC + eC;
- Console.WriteLine($"Total votes = {votes}, Money in market = {totalMarket:f2} EUR");
- Console.WriteLine($"DOGE's contribution: {((dC / totalMarket) * 100):f2}%; People who use DOGE: {dV}");
- Console.WriteLine($"IOTA's contribution: {((iC / totalMarket) * 100):f2}%; People who use IOTA: {iV}");
- Console.WriteLine($"NEO's contribution: {((nC / totalMarket) * 100):f2}%; People who use NEO: {nV}");
- Console.WriteLine($"ESTD's contribution: {((eC / totalMarket) * 100):f2}%; People who use ESTD: {eV}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement