Daniel_007

01. Trip To World Cup

Nov 2nd, 2019
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.69 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Exam
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             double priceGoing = double.Parse(Console.ReadLine());
  10.             double priceComming = double.Parse(Console.ReadLine());
  11.             double priceGame = double.Parse(Console.ReadLine());
  12.             int howManyGames = int.Parse(Console.ReadLine());
  13.             double discount = int.Parse(Console.ReadLine());
  14.             double all = 6 *(priceGoing + priceComming) * (1 - discount / 100 )+ howManyGames*priceGame*6;
  15.             Console.WriteLine($"Total sum: {all:F2} lv.");
  16.             Console.WriteLine($"Each friend has to pay {all/6:F2} lv.");
  17.  
  18.  
  19.  
  20.         }
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment