Advertisement
Guest User

Untitled

a guest
Dec 17th, 2017
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.10 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApp22
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int n = int.Parse(Console.ReadLine());
  14. double dogeMoney = 0;
  15. double neoMoney = 0;
  16. double iotaMoney = 0;
  17. double estdMoney = 0;
  18. int peopleDoge = 0;
  19. int peopleNeo = 0;
  20. int peopleEstd = 0;
  21. int peopleIota = 0;
  22.  
  23. for (int i = 0; i < n; i++)
  24. {
  25. string crypto = Console.ReadLine().ToLower();
  26. double count = double.Parse(Console.ReadLine());
  27. if (crypto == "doge")
  28. {
  29. dogeMoney = dogeMoney + count * 0.07;
  30. peopleDoge++;
  31. }
  32. else if (crypto == "iota")
  33. {
  34. iotaMoney = iotaMoney + count * 1.44;
  35. peopleIota++;
  36. }
  37. else if (crypto == "neo")
  38. {
  39. neoMoney = neoMoney + count * 28.5;
  40. peopleNeo++;
  41. }
  42. else if (crypto == "estd")
  43. {
  44. estdMoney = estdMoney + count * 25;
  45. peopleEstd++;
  46. }
  47.  
  48. }
  49. double allMoney = estdMoney + neoMoney + iotaMoney + dogeMoney;
  50. Console.WriteLine("Total votes = {0}, Money in market = {1:f2} EUR", n, allMoney);
  51. Console.WriteLine("DOGE's contribution: {0:f2}%; People who use DOGE: {1}", dogeMoney/allMoney * 100,peopleDoge);
  52. Console.WriteLine("IOTA's contribution: {0:f2}%; People who use IOTA: {1}", iotaMoney / allMoney * 100, peopleIota);
  53. Console.WriteLine("NEO's contribution: {0:f2}%; People who use NEO: {1}", neoMoney / allMoney * 100, peopleNeo);
  54. Console.WriteLine("ESTD's contribution: {0:f2}%; People who use ESTD: {1}", estdMoney / allMoney * 100, peopleEstd);
  55. }
  56. }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement