Advertisement
Guest User

Untitled

a guest
Jan 27th, 2023
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.68 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Diagnostics.CodeAnalysis;
  4. using System.Diagnostics.SymbolStore;
  5. using System.Linq;
  6. using System.Text;
  7.  
  8. class Program
  9. {
  10.     static void Main()
  11.     {
  12.         int lines = Convert.ToInt32(Console.ReadLine());
  13.         double percent = 0.35;   // can be "readline" for custom discount, current 65%
  14.         double discount;
  15.         string result = "";
  16.         for (int i = 0; i < lines; i++)
  17.         {
  18.             double digit = Convert.ToDouble(Console.ReadLine());
  19.             discount = digit * percent;
  20.             result =$"{result:F2}{discount:F2}\n";
  21.         }
  22.  
  23.         Console.WriteLine($"{result:F2}");
  24.  
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement