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