nikolayneykov

Untitled

Oct 14th, 2018
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.05 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 Salary
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int n = int.Parse(Console.ReadLine());
  14.             double salary = double.Parse(Console.ReadLine());
  15.             for (int i = 0; salary > 0 && i < n; i++)
  16.             {
  17.                 string sites = Console.ReadLine();
  18.  
  19.                 if (sites == "Facebook")
  20.                 {
  21.                     salary -= 150.00;
  22.                 }
  23.                 if (sites == "Instagram")
  24.                 {
  25.                     salary -= 100.00;
  26.                 }
  27.                 if (sites == "Reddit")
  28.                 {
  29.                     salary -= 50.00;
  30.                 }
  31.    
  32.             }
  33.  
  34.             if (salary <= 0)
  35.             {
  36.                 Console.WriteLine("You have lost your salary.");
  37.             }
  38.             else
  39.             {
  40.                 Console.WriteLine(salary);
  41.             }
  42.  
  43.         }
  44.     }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment