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