Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int maxRandomNumber = 100;
- int minRandomNumber = 1;
- int degree = 0;
- int baseOfDegree = 2;
- int resultNumber = 1;
- Random random = new Random();
- int number = random.Next(minRandomNumber, maxRandomNumber);
- while (resultNumber <= number)
- {
- degree++;
- resultNumber *= baseOfDegree;
- }
- Console.WriteLine($"Cлучайное число: {number}.\n{baseOfDegree} в степень {degree}\nИтоговое число: {resultNumber}");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement