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