Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace For_Salary
- {
- class Program
- {
- static void Main(string[] args)
- {
- var salary = decimal.Parse(Console.ReadLine());
- int n = int.Parse(Console.ReadLine());
- string result = string.Empty;
- for (int i = 0; i < n; i++)
- {
- string web = Console.ReadLine();
- switch (web)
- {
- case "Facebook":
- salary -= 150; break;
- case "Instagram":
- salary -= 100; break;
- case "Reddit":
- salary -= 50; break;
- }
- if (salary <= 0)
- {
- result = "You have lost your salary."; break;
- }
- }
- if (salary > 0)
- {
- Console.WriteLine($"{salary}");
- }
- Console.WriteLine(result);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment