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