Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Footbal
- {
- class Program
- {
- static void Main(string[] args)
- {
- double numberDays = double.Parse(Console.ReadLine());
- double kilometres = double.Parse(Console.ReadLine());
- double totalKm = kilometres;
- for (int i = 1; i <= numberDays; i++)
- {
- double daysCount = double.Parse(Console.ReadLine());
- kilometres = kilometres + (kilometres * (daysCount / 100.0));
- totalKm = totalKm + kilometres;
- }
- if (totalKm >= 1000)
- {
- var notEnoughKm1 = Math.Floor(1000 - totalKm);
- notEnoughKm1 = Math.Abs(notEnoughKm1);
- Console.WriteLine($"You've done a great job running {notEnoughKm1} more kilometers!");
- }
- else
- {
- var notEnoughKm2 = Math.Ceiling(1000 - totalKm);
- Console.WriteLine($"Sorry Mrs. Ivanova, you need to run {notEnoughKm2} more kilometers");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment