Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp27
- {
- class Program
- {
- static void Main(string[] args)
- {
- int lostGames = int.Parse(Console.ReadLine());
- double headSetPrice = Double.Parse(Console.ReadLine());
- double mousePrice = Double.Parse(Console.ReadLine());
- double keyboardPrice = Double.Parse(Console.ReadLine());
- double DisplayPrice = Double.Parse(Console.ReadLine());
- double fullPrice = 0;
- for (int i = 2; i <= lostGames; i += 2)
- {
- fullPrice += headSetPrice;
- }
- double firstTurn = fullPrice;
- for (int j = 3; j <= lostGames; j += 3)
- {
- fullPrice += mousePrice;
- }
- double secondTurn = fullPrice;
- // ako e delimo na tri znachi si e chupil i klaviaturata znachi
- for (int i = 1; i <= lostGames; i++)
- {
- if (i % 2 == 0 && i % 3 == 0)
- {
- if (fullPrice - (keyboardPrice * 2) == secondTurn)
- {
- fullPrice += DisplayPrice;
- }
- fullPrice += keyboardPrice;
- }
- }
- Console.WriteLine(fullPrice);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement