Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace P01
- {
- class Program
- {
- static void Main(string[] args)
- {
- int days = int.Parse(Console.ReadLine());
- int players = int.Parse(Console.ReadLine());
- double energy = double.Parse(Console.ReadLine());
- double water = days * players * double.Parse(Console.ReadLine());
- double food = days * players * double.Parse(Console.ReadLine());
- for (int i = 1; i <= days; i++)
- {
- energy -= double.Parse(Console.ReadLine());
- if (energy <= 0)
- {
- break;
- }
- if (i % 2 == 0)
- {
- water *= 0.7;
- energy *= 1.05;
- }
- if (i % 3 == 0)
- {
- food -= food / players;
- energy *= 1.1;
- }
- }
- if (energy > 0)
- {
- Console.WriteLine($"You are ready for the quest. You will be left with - {energy:f2} energy!");
- }
- else
- {
- Console.WriteLine($"You will run out of energy. You will be left with {food:f2} food and {water:f2} water.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement