Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _04UmnataLili
- {
- class Program
- {
- static void Main(string[] args)
- {
- byte age = byte.Parse(Console.ReadLine());
- double washingMachines = double.Parse(Console.ReadLine());
- int priceGames = int.Parse(Console.ReadLine());
- int evenCount = 0;
- int oddCount = 0;
- int sum = 0;
- int sum1 = 0;
- int endSum = 0;
- for (int i = 1; i <= age; i++)
- {
- if (i % 2 == 0)
- {
- sum += 10;
- evenCount++;
- sum1 += sum;
- }
- else
- {
- oddCount++;
- }
- }
- endSum = (sum1 - evenCount) + (oddCount * priceGames);
- if (endSum >= washingMachines)
- {
- Console.WriteLine("Yes! {0:F2}",(endSum - washingMachines));
- }
- else
- {
- Console.WriteLine("No! {0:F2}",(washingMachines - endSum));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement