Advertisement
Alexander_B

Salary

Feb 17th, 2019
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 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 DomasnoSalary
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int nTabs = int.Parse(Console.ReadLine());
  14. int salary = int.Parse(Console.ReadLine());
  15.  
  16. int taxFacebook = 150;
  17. int taxInstagram = 100;
  18. int taxReddit = 50;
  19.  
  20.  
  21. for(int i = 0; i < nTabs; i++)
  22. {
  23. if (salary <= 0)
  24. {
  25. break;
  26. }
  27. else
  28. {
  29. string input = Console.ReadLine().ToLower();
  30.  
  31. switch (input)
  32. {
  33. case "facebook":
  34.  
  35. salary -= taxFacebook;
  36.  
  37. break;
  38.  
  39. case"instagram":
  40.  
  41. salary -= taxInstagram;
  42.  
  43. break;
  44.  
  45. case"reddit":
  46.  
  47. salary -= taxReddit;
  48.  
  49. break;
  50. }
  51. }
  52. }
  53.  
  54. if (salary <= 0)
  55. {
  56. Console.WriteLine("You have lost your salary.");
  57. }
  58. else
  59. {
  60. Console.WriteLine($"{salary}");
  61. }
  62. }
  63. }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement