Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace HomeWork
- {
- internal class Program
- {
- public static void Main(string[] args)
- {
- Random random = new Random();
- int min = 1;
- int max = 101;
- int number;
- int exponentiatedNumber = 2;
- int power = 0;
- int result = 1;
- number = random.Next(min, max + 1);
- Console.WriteLine($"Заданное число: {number}");
- while (result <= number)
- {
- result *= exponentiatedNumber;
- power++;
- }
- Console.WriteLine($"Минимальная степень двойки: {exponentiatedNumber}^{power} = {result}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement