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