Advertisement
vovanhik_24

#17

Aug 23rd, 2023 (edited)
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.59 KB | None | 0 0
  1.             int maxRandomNumber = 100;
  2.             int minRandomNumber = 1;
  3.             int degree = 0;
  4.             int baseOfDegree = 2;
  5.             int resultNumber = 1;
  6.  
  7.             Random random = new Random();
  8.             int number = random.Next(minRandomNumber, maxRandomNumber);
  9.  
  10.             while (resultNumber <= number)
  11.             {
  12.                 degree++;
  13.                 resultNumber *= baseOfDegree;
  14.             }
  15.  
  16.             Console.WriteLine($"Cлучайное число: {number}.\n{baseOfDegree} в степень {degree}\nИтоговое число: {resultNumber}");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement