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)
- {
- double x = Double.Parse(Console.ReadLine());
- double p = Double.Parse(Console.ReadLine());
- double t = Double.Parse(Console.ReadLine());
- double e = Double.Parse(Console.ReadLine());
- double n = Double.Parse(Console.ReadLine());
- double profit = x * t - x * p;
- double etherumPrice = t * 0.075;
- double neoPrice = etherumPrice * 0.4;
- double investitionPrice = etherumPrice * e + neoPrice * n;
- if (profit > investitionPrice)
- {
- Console.WriteLine($"Stefcho bought {e:f4} Ethereum at a price of {etherumPrice:f4} ");
- Console.WriteLine($"Stefcho bought {n:f4} Neo at a price of {neoPrice:f4} ");
- Console.WriteLine($"Stefcho has {(profit - investitionPrice):f2} profits left to spend.");
- }
- else
- {
- Console.WriteLine("Stefcho does not have enough money to make this investment.");
- Console.WriteLine($"He needs {(investitionPrice - profit):f2} more in profits");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement