Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace BeersForTrip
- {
- class Program
- {
- static void Main(string[] args)
- {
- int days = int.Parse(Console.ReadLine());
- double beersForTheDay = 0.0;
- int dayCounter = 0;
- double totalBeers = 0.0;
- for (int i = 0; i < days; i++)
- {
- dayCounter++;
- if (dayCounter>7)
- {
- dayCounter = 1;
- }
- int kmForTheDay = int.Parse(Console.ReadLine());
- if (dayCounter == 3)
- {
- continue;
- }
- else if (dayCounter == 6 || dayCounter == 7)
- {
- totalBeers += (2*3);
- }
- else
- {
- beersForTheDay = ((kmForTheDay / 100.0) * 3);
- totalBeers += beersForTheDay;
- }
- }
- Console.WriteLine($"Beers needed for the trip: {Math.Ceiling(totalBeers)}") ;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement