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