Advertisement
reking12

Untitled

Nov 2nd, 2018
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.61 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 _6.Лодка_за_риболов
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int budget = int.Parse(Console.ReadLine());
  14.             string season = Console.ReadLine();
  15.             int numberFishers = int.Parse(Console.ReadLine());
  16.  
  17.             double naem = 0;
  18.             if (season == "Spring")
  19.             {
  20.                 naem = 3000;
  21.                
  22.             }
  23.             else if (season == "Summer" || season == "Autumn")
  24.             {
  25.                 naem = 4200;
  26.                
  27.             }
  28.            
  29.            
  30.             else if (season == "Winter")
  31.             {
  32.                 naem = 2600;
  33.                
  34.             }
  35.             if (numberFishers <= 6)
  36.             {
  37.                 naem *= 0.90;
  38.             }
  39.             else if (numberFishers > 7 && numberFishers <= 11)
  40.             {
  41.                 naem *= 0.85;
  42.             }
  43.             else if (numberFishers >= 12)
  44.             {
  45.                 naem *= 0.75;
  46.             }
  47.             if (numberFishers % 2 == 0 && season != "Autumn")
  48.             {
  49.                 naem *=0.95;
  50.             }
  51.             if (budget < naem)
  52.             {
  53.                 Console.WriteLine($"Not enough money! You need {naem - budget:f2} leva.");
  54.                
  55.             }
  56.             else
  57.             {
  58.                 Console.WriteLine($"Yes! You have {budget - naem:f2} leva left.");
  59.                
  60.             }
  61.  
  62.         }
  63.     }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement