Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 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 ConsoleApplication1
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. var coefficient =
  14. decimal.Parse(Console.ReadLine());
  15. var purchases =
  16. int.Parse(Console.ReadLine());
  17.  
  18. decimal sum = 0.0m;
  19.  
  20. for (int i = 0; i < purchases; i++)
  21. {
  22. var qty = int.Parse(Console.ReadLine());
  23. var name = Console.ReadLine();
  24. var price = decimal.Parse(Console.ReadLine());
  25. var dds = price * coefficient;
  26. sum += dds*qty;
  27. Console.WriteLine("{0} : {1:F8} {2:F8} {3:F8}",
  28. name, price - dds, dds, price);
  29. }
  30. Console.WriteLine(sum);
  31. }
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement