bacco

Семейство Иванови :Ivanovi's Family

Feb 6th, 2018
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.58 KB | None | 0 0
  1. using System;
  2.  
  3. namespace tESt
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             var budget = double.Parse(Console.ReadLine());
  10.             var giftOne = double.Parse(Console.ReadLine());
  11.             var giftTwo = double.Parse(Console.ReadLine());
  12.             var giftThree = double.Parse(Console.ReadLine());
  13.  
  14.             var giftsTotal = giftOne + giftTwo + giftThree;
  15.             var donation = (budget - giftsTotal) - ((budget - giftsTotal) * 0.10);    // 10%
  16.  
  17.             Console.WriteLine($"{donation:f2}");
  18.         }
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment