Advertisement
Guest User

Втора

a guest
Dec 17th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 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 Exam
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. double x = Double.Parse(Console.ReadLine());
  14. double p = Double.Parse(Console.ReadLine());
  15. double t = Double.Parse(Console.ReadLine());
  16. double e = Double.Parse(Console.ReadLine());
  17. double n = Double.Parse(Console.ReadLine());
  18. double profit = x * t - x * p;
  19. double etherumPrice = t * 0.075;
  20. double neoPrice = etherumPrice * 0.4;
  21. double investitionPrice = etherumPrice * e + neoPrice * n;
  22. if (profit > investitionPrice)
  23. {
  24. Console.WriteLine($"Stefcho bought {e:f4} Ethereum at a price of {etherumPrice:f4} ");
  25. Console.WriteLine($"Stefcho bought {n:f4} Neo at a price of {neoPrice:f4} ");
  26. Console.WriteLine($"Stefcho has {(profit - investitionPrice):f2} profits left to spend.");
  27. }
  28. else
  29. {
  30. Console.WriteLine("Stefcho does not have enough money to make this investment.");
  31. Console.WriteLine($"He needs {(investitionPrice - profit):f2} more in profits");
  32. }
  33. }
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement