Advertisement
Guest User

7.Salary-SoftUni

a guest
Nov 18th, 2018
372
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApp1
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int nTabs = int.Parse(Console.ReadLine());
  10. int salary = int.Parse(Console.ReadLine());
  11.  
  12. for (int i = 0; i < nTabs; i++)
  13. {
  14. string websiteName = Console.ReadLine();
  15.  
  16. if (websiteName == "Facebook")
  17. {
  18. salary -= 150;
  19. if (salary <= 0)
  20. {
  21. Console.WriteLine("You have lost your salary.");
  22. return;
  23. }
  24. }
  25. else if (websiteName == "Instagram")
  26. {
  27. salary -= 100;
  28. if (salary <= 0)
  29. {
  30. Console.WriteLine("You have lost your salary.");
  31. return;
  32. }
  33. }
  34. else if (websiteName == "Reddit")
  35. {
  36. salary -= 50;
  37. if (salary <= 0)
  38. {
  39. Console.WriteLine("You have lost your salary.");
  40. return;
  41. }
  42. }
  43. }
  44. Console.WriteLine(salary);
  45. }
  46. }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement