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