Advertisement
KrasenPenev

slary

Feb 4th, 2020
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 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 Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int numTabsN = int.Parse(Console.ReadLine());
  14. double salary = double.Parse(Console.ReadLine());
  15.  
  16. for (int i = 0; i < numTabsN; i++)
  17. {
  18. string nameTabs = Console.ReadLine();
  19.  
  20. if (nameTabs=="Facebook")
  21. {
  22. salary -= 150;
  23. }
  24. else if (nameTabs=="Instagram")
  25. {
  26. salary -= 100;
  27. }
  28. else if (nameTabs=="Reddit")
  29. {
  30. salary -= 50;
  31. }
  32. else
  33. {
  34. salary = salary;
  35. }
  36. }
  37. if (salary == 0)
  38. {
  39. Console.WriteLine($"You have lost your salary.");
  40. }
  41. else
  42. {
  43. Console.WriteLine(salary);
  44. }
  45. }
  46. }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement