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 ConsoleApp22
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- double dogeMoney = 0;
- double neoMoney = 0;
- double iotaMoney = 0;
- double estdMoney = 0;
- int peopleDoge = 0;
- int peopleNeo = 0;
- int peopleEstd = 0;
- int peopleIota = 0;
- for (int i = 0; i < n; i++)
- {
- string crypto = Console.ReadLine().ToLower();
- double count = double.Parse(Console.ReadLine());
- if (crypto == "doge")
- {
- dogeMoney = dogeMoney + count * 0.07;
- peopleDoge++;
- }
- else if (crypto == "iota")
- {
- iotaMoney = iotaMoney + count * 1.44;
- peopleIota++;
- }
- else if (crypto == "neo")
- {
- neoMoney = neoMoney + count * 28.5;
- peopleNeo++;
- }
- else if (crypto == "estd")
- {
- estdMoney = estdMoney + count * 25;
- peopleEstd++;
- }
- }
- double allMoney = estdMoney + neoMoney + iotaMoney + dogeMoney;
- Console.WriteLine("Total votes = {0}, Money in market = {1:f2} EUR", n, allMoney);
- Console.WriteLine("DOGE's contribution: {0:f2}%; People who use DOGE: {1}", dogeMoney/allMoney * 100,peopleDoge);
- Console.WriteLine("IOTA's contribution: {0:f2}%; People who use IOTA: {1}", iotaMoney / allMoney * 100, peopleIota);
- Console.WriteLine("NEO's contribution: {0:f2}%; People who use NEO: {1}", neoMoney / allMoney * 100, peopleNeo);
- Console.WriteLine("ESTD's contribution: {0:f2}%; People who use ESTD: {1}", estdMoney / allMoney * 100, peopleEstd);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement