Advertisement
alexandrheathen

Untitled

Sep 26th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.45 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Test
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int startDistance = 10;
  10.             int percent;
  11.             Console.Write("Введите процент: ");
  12.             percent = Int32.Parse(Console.ReadLine());
  13.             int days = 1;
  14.             float finishDist = startDistance;
  15.             bool tempBoolean = false;
  16.             Console.WriteLine("День 1:\nПройдено: " + finishDist);
  17.             while (!tempBoolean)
  18.             {
  19.                 if(finishDist >= 200)
  20.                 {
  21.                     tempBoolean = true;
  22.                 }
  23.                 else
  24.                 {
  25.                     days++;
  26.                     Console.WriteLine("~~~~~~~~~~ ДЕНЬ " + days + " ~~~~~~~~~~");
  27.                     float k = (finishDist / 100 * percent);
  28.                     Console.WriteLine("Уже пройдено: " + finishDist);
  29.                     Console.WriteLine("Процент: " + k);
  30.                     float yet = 0;
  31.                     yet = finishDist + k;
  32.                     Console.WriteLine("За сегодня: " + yet);
  33.                     finishDist += yet;
  34.                     Console.WriteLine("Теперь сумарно прошли: " + finishDist);
  35.                     Console.WriteLine("\n\n\n\n");
  36.                 }
  37.             }
  38.             Console.WriteLine("Количество дней: " + days);
  39.         }
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement