GabrielaGynchevska

Untitled

Jul 15th, 2017
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 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 ConsoleApp1
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int number = int.Parse(Console.ReadLine());
  14. double bonusPounts = 0;
  15.  
  16. if (number <= 100)
  17. {
  18. // 5 bonux tochki
  19. bonusPounts = 5;
  20. }
  21. else if (number > 1000)
  22. {
  23. //10 % bonux tochki
  24. double percent = 10.0 / 100;
  25. bonusPounts = percent * number;
  26. }
  27. else if (number > 100)
  28. {
  29. // 20 % bonux tochki
  30. double percent = 20.0 / 100;
  31. bonusPounts = percent * number;
  32. }
  33.  
  34.  
  35.  
  36. if (number % 2 ==0)
  37. {
  38. bonusPounts = bonusPounts + 1;
  39. }
  40. else if (number % 10 == 5)
  41. {
  42. bonusPounts = bonusPounts + 2;
  43. }
  44. Console.WriteLine(bonusPounts);
  45. Console.WriteLine(bonusPounts + number);
  46. }
  47.  
  48. }
  49. }
Add Comment
Please, Sign In to add comment