Advertisement
Guest User

Untitled

a guest
May 22nd, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApp27
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int lostGames = int.Parse(Console.ReadLine());
  10. double headSetPrice = Double.Parse(Console.ReadLine());
  11. double mousePrice = Double.Parse(Console.ReadLine());
  12. double keyboardPrice = Double.Parse(Console.ReadLine());
  13. double DisplayPrice = Double.Parse(Console.ReadLine());
  14. double fullPrice = 0;
  15. for (int i = 2; i <= lostGames; i += 2)
  16. {
  17. fullPrice += headSetPrice;
  18. }
  19. double firstTurn = fullPrice;
  20. for (int j = 3; j <= lostGames; j += 3)
  21. {
  22. fullPrice += mousePrice;
  23. }
  24. double secondTurn = fullPrice;
  25. // ako e delimo na tri znachi si e chupil i klaviaturata znachi
  26.  
  27. for (int i = 1; i <= lostGames; i++)
  28. {
  29. if (i % 2 == 0 && i % 3 == 0)
  30. {
  31.  
  32.  
  33. if (fullPrice - (keyboardPrice * 2) == secondTurn)
  34. {
  35. fullPrice += DisplayPrice;
  36.  
  37. }
  38. fullPrice += keyboardPrice;
  39. }
  40. }
  41.  
  42.  
  43. Console.WriteLine(fullPrice);
  44. }
  45. }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement