Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Salary
- {
- class Program
- {
- static void Main(string[] args)
- {
- int CountTab = int.Parse(Console.ReadLine());
- double Salary = double.Parse(Console.ReadLine());
- for (int i = 1; i <= CountTab; i++)
- {
- string Site = Console.ReadLine();
- if (Salary > 0)
- {
- switch (Site)
- {
- case "Facebook":
- Salary -= 150;
- break;
- case "Instagram":
- Salary -= 100;
- break;
- case "Reddit":
- Salary -= 50;
- break;
- }
- }
- else
- {
- break;
- }
- }
- if (Salary>0)
- {
- Console.WriteLine($"{Salary:f0}");
- }
- else
- {
- Console.WriteLine("You have lost your salary.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment