Advertisement
Guest User

Untitled

a guest
Nov 17th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Salary
  8. {
  9. class Salary
  10. {
  11. static void Main(string[] args)
  12. {
  13. int tab = int.Parse(Console.ReadLine());
  14. int salary = int.Parse(Console.ReadLine());
  15.  
  16. int a = 150;
  17. int b = 100;
  18. int c = 50;
  19. int fine = 0;
  20. int counterA = 0;
  21. int counterB = 0;
  22. int counterC = 0;
  23.  
  24. for (int i = 0; i < tab; i++)
  25. {
  26. string site = Console.ReadLine();
  27.  
  28. if (site=="Facebook")
  29. {
  30. counterA++;
  31. }
  32. if (site=="Instagram")
  33. {
  34. counterB++;
  35. }
  36. if (site=="Reddit")
  37. {
  38. counterC++;
  39. }
  40. fine = (a * counterA) + (b * counterB) + (c * counterC);
  41.  
  42. if ((salary-fine)==0)
  43. {
  44. Console.WriteLine("You have lost your salary.");break;
  45. }
  46. }
  47. if (salary>fine)
  48. {
  49. Console.WriteLine($"{salary-fine}");
  50. }
  51. }
  52. }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement