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