Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Homework17
- {
- class Progarm
- {
- static void Main()
- {
- Random random = new Random();
- int minimumRandomNumber = 0;
- int maximimRandomNumber = 100;
- int degreeOfTwo = 0;
- int basisOfDegree = 2;
- int minimumNumber = 1;
- int specifiedNumber = random.Next(minimumRandomNumber, maximimRandomNumber);
- while (minimumNumber <= specifiedNumber)
- {
- degreeOfTwo++;
- minimumNumber *= basisOfDegree;
- }
- Console.WriteLine($"Случайное число: {specifiedNumber}.\nМинимальная степень двойки, превосходящая случайное число: {degreeOfTwo}.\nЧисло {basisOfDegree} в степени {degreeOfTwo}: {minimumNumber}. ");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement