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 ConsoleApplication1
- {
- class Program
- {
- static void Main(string[] args)
- {
- var coefficient =
- decimal.Parse(Console.ReadLine());
- var purchases =
- int.Parse(Console.ReadLine());
- decimal sum = 0.0m;
- for (int i = 0; i < purchases; i++)
- {
- var qty = int.Parse(Console.ReadLine());
- var name = Console.ReadLine();
- var price = decimal.Parse(Console.ReadLine());
- var dds = price * coefficient;
- sum += dds*qty;
- Console.WriteLine("{0} : {1:F8} {2:F8} {3:F8}",
- name, price - dds, dds, price);
- }
- Console.WriteLine(sum);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement