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