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 _53_Workout
- {
- class Program
- {
- static void Main(string[] args)
- {
- int N = int.Parse(Console.ReadLine());
- int M = int.Parse(Console.ReadLine());
- double totalKm = M;
- double kmSum = 0;
- for (int i = 1; i <= N; i++)
- {
- double kmInPercent = double.Parse(Console.ReadLine());
- totalKm = totalKm + totalKm * (kmInPercent / 100);
- kmSum += totalKm;
- }
- if (totalKm < 1000)
- {
- Console.WriteLine($"Sorry Mrs. Ivanova, you need to run {Math.Ceiling(1000 - kmSum)} more kilometers");
- }
- else
- {
- Console.WriteLine($"You've done a great job running {Math.Ceiling(kmSum - 1000)} more kilometers!");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement