Advertisement
lenyaplay

Untitled

Oct 15th, 2021
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 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 Task1
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. Console.WriteLine("Введите начальный вес");
  14. double mass = double.Parse(Console.ReadLine());
  15. Console.WriteLine("Введите желаемый вес");
  16. double recomend_mass = double.Parse(Console.ReadLine());
  17. double mass_lost_on_day = 1 / 100.0;
  18.  
  19. int day = 0;
  20. while(mass > recomend_mass)
  21. {
  22. day++;
  23. mass -= mass * mass_lost_on_day;
  24. }
  25. Console.WriteLine($"День: {day} Получившееся масса: {mass}");
  26. Console.ReadKey();
  27. }
  28. }
  29. }
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement