Advertisement
knikolov98

Untitled

Oct 15th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.04 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Salary
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int tabs = int.Parse(Console.ReadLine());
  10.             int salary = int.Parse(Console.ReadLine());
  11.  
  12.             string website = string.Empty;
  13.  
  14.             for (int i = 0; i < tabs; i++)
  15.             {
  16.                 website = Console.ReadLine();
  17.  
  18.                 if (website == "Facebook")
  19.                 {
  20.                     salary -= 150;
  21.                 }
  22.                 else if (website == "Instagram")
  23.                 {
  24.                     salary -= 100;
  25.                 }
  26.                 else if (website == "Reddit")
  27.                 {
  28.                     salary -= 50;
  29.                 }
  30.  
  31.                 if (salary <= 0)
  32.                 {
  33.  
  34.                     Console.WriteLine("You have lost your salary.");
  35.                     break;
  36.  
  37.                 }
  38.             }
  39.  
  40.             if (salary > 0)
  41.             {
  42.                 Console.WriteLine(salary);
  43.             }
  44.  
  45.  
  46.         }
  47.     }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement