Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Salary
- {
- class Salary
- {
- static void Main(string[] args)
- {
- int tab = int.Parse(Console.ReadLine());
- int salary = int.Parse(Console.ReadLine());
- int a = 150;
- int b = 100;
- int c = 50;
- int fine = 0;
- int counterA = 0;
- int counterB = 0;
- int counterC = 0;
- for (int i = 0; i < tab; i++)
- {
- string site = Console.ReadLine();
- if (site=="Facebook")
- {
- counterA++;
- }
- if (site=="Instagram")
- {
- counterB++;
- }
- if (site=="Reddit")
- {
- counterC++;
- }
- fine = (a * counterA) + (b * counterB) + (c * counterC);
- if ((salary-fine)==0)
- {
- Console.WriteLine("You have lost your salary.");break;
- }
- }
- if (salary>fine)
- {
- Console.WriteLine($"{salary-fine}");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement