desislava777

Workout

Jan 2nd, 2018
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApplication25
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int N = int.Parse(Console.ReadLine());
  14. double M = double.Parse(Console.ReadLine());
  15. double Allkm = M;
  16. for(int i=1; i<=N; i++)
  17. {
  18. int k = int.Parse(Console.ReadLine());
  19. M = M + (M / 100) * k;
  20. Allkm += M;
  21. }
  22. if(Allkm<1000)
  23. {
  24. Console.WriteLine("Sorry Mrs. Ivanova, you need to run {0} more kilometers",Math.Ceiling(1000-Allkm));
  25. }
  26. else if(Allkm>=1000)
  27. {
  28. Console.WriteLine("You've done a great job running {0} more kilometers!",Math.Ceiling(Allkm-1000));
  29. }
  30. }
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment