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